Skip to content

Instantly share code, notes, and snippets.

@stevo
Created May 8, 2018 09:21
Show Gist options
  • Save stevo/476aac46f6ee179610b89686c91e9d79 to your computer and use it in GitHub Desktop.
Save stevo/476aac46f6ee179610b89686c91e9d79 to your computer and use it in GitHub Desktop.
An opinionated guide to readable RSpec (part 2 of 2)
expect(OMDBClient).to receive(:get_movie).with(t: 'The Rock') {
{
"Title" => "The Rock",
"Year" => "1996",
"Rated" => "R",
"Released" => "07 Jun 1996",
"Runtime" => "136 min",
"Genre" => "Action, Adventure, Thriller"
}
}
result = OMDBWrapper.get_movie_by_title('The Rock')
expect(result).to be_a_kind_of(Movie).and(have_attributes(title: 'The Rock', year: 1996))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment