Skip to content

Instantly share code, notes, and snippets.

@orbanbotond
Created January 23, 2015 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orbanbotond/26e180e949e222a9e1a0 to your computer and use it in GitHub Desktop.
Save orbanbotond/26e180e949e222a9e1a0 to your computer and use it in GitHub Desktop.
Rspec noun-phrase
be_odd
be_an
be_done
be_an_ufo calls ufo?
an_object_eq_to
an_object_having_attributes
a_string_starting_with
a_string_ending_with
a_string_matching
a_value
a_collection_containing_exactly
an_instance_of
noun-phrase rather than verb form:
be < 2 => a_value < 2
be > 2 => a_value > 2
be_an_instance_of => an_instance_of
be_within => a_value_within
contain_exactly => a_collection_containing_exactly
end_with => a_string_ending_with, ending_with
match => a_string_matching
start_with => a_string_starting_with
RSpec::Matchers
https://github.com/rspec/rspec-expectations/blob/master/lib/rspec/matchers.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment