undefined method 'assert_equal' for #<RSpec::Core::ExampleGroup::Nested_1:0x8d6f75c>
gem list
bundler (1.3.5)
diff-lcs (1.2.3)
rspec (2.13.0)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
rspec-mocks (2.13.1)
test-unit (2.5.4)
spec_helper.rb
require './lib/checkout.rb'
require './lib/product.rb'
require 'rspec'
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
config.filter_run :focus
end
最佳答案
试试 object.should eq('foo')
或 expect(object).to eq('foo')
。作为旁注,object.should == 'foo'
将在使用 -w
标志运行时向您发出 Ruby 警告。
此外,这是一个假设答案,因为您没有给我们任何实际代码。
关于ruby-on-rails - rspec assert_equal 没有方法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15999165/