Ruby Rspec 2.8.0,expect(something)导致ArgumentError:参数数量错误(1代表0)
我有一个RSPEC2.8.0的新回购协议(非rails) 出于某种奇怪的原因,我不能使用expect语法 这个荒谬的规范:Ruby Rspec 2.8.0,expect(something)导致ArgumentError:参数数量错误(1代表0),ruby,rspec,Ruby,Rspec,我有一个RSPEC2.8.0的新回购协议(非rails) 出于某种奇怪的原因,我不能使用expect语法 这个荒谬的规范: require "spec_helper" describe "The Truth" do it "is true" do expect(true).to be_true end end Failure/Error: expect(true).to be_true ArgumentError: wrong number of a
require "spec_helper"
describe "The Truth" do
it "is true" do
expect(true).to be_true
end
end
Failure/Error: expect(true).to be_true
ArgumentError:
wrong number of arguments (1 for 0)
原因:
require "spec_helper"
describe "The Truth" do
it "is true" do
expect(true).to be_true
end
end
Failure/Error: expect(true).to be_true
ArgumentError:
wrong number of arguments (1 for 0)
spec\u helper
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
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = 'random'
config.expect_with :rspec do |c|
c.syntax = :expect
end
end
这里说expect语法出现在rspec2.11中,所以我猜2.8是旧的这里说expect语法出现在rspec2.11中,所以我猜2.8是旧的