I'm trying to run the basic starter example for using rspec found here: http://rspec.info/.
When I type in the command prompt
ruby bowling_spec.rb
I get the following error
Test
# bowling_spec.rb
require 'bowling'
describe Bowling, "#score" do
it "returns 0 for all gutter game" do
bowling = Bowling.new
20.times { bowling.hit(0) }
bowling.score.should == 0
end
end
Code
# bowling.rb
class Bowling
def hit(pins)
end
def score
0
end
end
Error Message
internal:lib/rubygems/custom_require:29:in
require': no such file to load -- bowling (LoadError) from <internal:lib/rubygems/custom_require>:29:in
require' from bowling_spec.rb:2:in `'
This is a great simple example to get started with rspec. To make everything work do the following:
rspec
spec/bowling_spec.rb
if you are using rpsec 2.spec spec/bowling_spec.rb
if you are using rspec 1.Also, an updated example can be found here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With