rspec_rails_4
rspec_rails_4 copied to clipboard
Ch.9, be_named matcher should use "=="
In be_named matcher, eq is used but it fails with message "ArgumentError: wrong number of arguments (1 for 0)". According to the RSpec document, it should be "==".
RSpec::Matchers.define :be_named do |expected|
match do |actual|
# not work
# actual.name eq expected
# should be
actual.name == expected
end
description do
"return a full name as a string"
end
end