Open
Description
This issue is about avoiding brittle tests, by using RSpec Matchers which only check for the data the tested behavior needs.
One example failure: https://circleci.com/gh/szemek/github-changelog-generator/54
Failures:
1) GitHubChangelogGenerator::OctoFetcher#fetch_commit when API call is valid returns commit
Failure/Error: expect(commit[property]).to eq(val)
expected: {"avatar_url"=>"https://avatars2.githubusercontent.com/u/3356474?v=4", "events_url"=>"https://api.git...com/users/skywinder/subscriptions", "type"=>"User", "url"=>"https://api.github.com/users/skywinder"}
got: {"avatar_url"=>"https://avatars2.githubusercontent.com/u/3356474?v=4", "events_url"=>"https://api.git...com/users/skywinder/subscriptions", "type"=>"User", "url"=>"https://api.github.com/users/skywinder"}
(compared using ==)
Diff:
@@ -7,6 +7,7 @@
"html_url" => "https://github.com/skywinder",
"id" => 3356474,
"login" => "skywinder",
+"node_id" => "MDQ6VXNlcjMzNTY0NzQ=",
"organizations_url" => "https://api.github.com/users/skywinder/orgs",
"received_events_url" => "https://api.github.com/users/skywinder/received_events",
"repos_url" => "https://api.github.com/users/skywinder/repos",
# ./spec/unit/octo_fetcher_spec.rb:524:in `block (5 levels) in <top (required)>'