I've got a cucumber,ruby,siteprism project where we're using the 'rspec' gem to check expectations. This is included in our env.rb and used successfully in the step definitions.
I was now trying to make some assertions in a SitePrism class but I am getting an error. Do you know how I could use those expect() methods?
I tried with require 'rspec'
plus include Rspec
in the .rb file which is defining the SitePrism class, but I got the same error still:
expect(local_value).to eq(@previous_value)
=> Error: NoMethodError: undefined method `expect' for #<xxx_Object @loaded=false>
Thank you!
include RSpec::Matchers
in the class and that seems to pass theexpect
error message. However, I then got another related one, any suggestion for fixing this error, or including theexpect
in a different way? NoMethodError: undefined method `map' for #<RSpec::Matchers::BuiltIn::All:0x000000067a5ac0> Did you mean? tap – Gallinule