HomePhorge

(maint) Avoid rspec examples using variable behavior
87579d6355b2Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(maint) Avoid rspec examples using variable behavior

Given an object with an attr_accessor and using an example shortcut like so:

subject { metadata.to_hash }

its(:keys) do
  subject.sort.should == %w[ name version author summary license source issues_url project_page dependencies ].sort
end

The value of subject in the example varies between RSpec 2.11 and 2.13.
This commit removes the shortcut in favor of a slightly longer but more
compatible test that explicitly invokes the #keys method and does an
expectation on that.

Details

Provenance
Adrien Thebo <git@somethingsinistral.net>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUe45a62445362: (maint) Never require rspec/mocks
Branches
Unknown
Tags
Unknown

Event Timeline

Adrien Thebo <git@somethingsinistral.net> committed rPU87579d6355b2: (maint) Avoid rspec examples using variable behavior (authored by Adrien Thebo <git@somethingsinistral.net>).Jul 15 2014, 10:21 PM