4

I tried the following and got the associated error:

Failure/Error: reminders_array.should be_an(Array)
     NoMethodError:
       undefined method `should' for #<Array:0x0000000202c9a0>

reminders_array should be an Array and I would like to check for it with an Rspec test. How should I do it differently from the tested assertion above?

1 Answer 1

5

should is old syntax, you should do like this:

expect(reminders_array).to be_an(Array) 

or:

expect(reminders_array).to be_an_instance_of(Array)

You can get more info from rspec-expectations

Sign up to request clarification or add additional context in comments.

3 Comments

yes, I tried it and still got an error showing it above.
@Angela It is impossible, can you show the full error stack?
it works now, it wasn't working when I first tried the same thing without should....well, I guess it's working then, thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.