Created
May 8, 2018 09:21
-
-
Save stevo/476aac46f6ee179610b89686c91e9d79 to your computer and use it in GitHub Desktop.
An opinionated guide to readable RSpec (part 2 of 2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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