I can’t figure out what is ‘be’ when using rpec.
target.should be 5
I know how to use it, but how is it implemented? Is it something like an operator i.e.
target.should.send(:be, 5)
How can I implement something similar?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
beis a method which returns an RSpec Matcher, as mentioned by d11wtq in a comment aboveYou can implement any other method which returns a matcher, but there are other, simpler ways to write a matcher.