Skip to content

Instantly share code, notes, and snippets.

@RyanSnodgrass
Created April 8, 2014 21:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyanSnodgrass/10195969 to your computer and use it in GitHub Desktop.
Save RyanSnodgrass/10195969 to your computer and use it in GitHub Desktop.
require 'rspec'
require './horserace.rb'
describe Horse do
let(:horse) {Horse.new}
it 'should exist' do
horse.should_not eq(nil)
end
it 'should create user horse' do
user_horse = Horse.new(true)
user_horse.stub(:gets).and_return("tripod")
user_horse.get_name.should eq("tripod")
end
it 'should do bot run' do
horse.bot_run.should_not eq(nil)
end
end
describe Game do
let(:play) {Game.new}
it 'should print graphic' do
play.horse_graphic.should_not eq(nil)
end
it 'should print bot tracks' do
play.matz_track.should_not eq(nil)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment