Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Created January 15, 2016 08:53
Show Gist options
  • Select an option

  • Save YumaInaura/1eeed62daa430d2468d6 to your computer and use it in GitHub Desktop.

Select an option

Save YumaInaura/1eeed62daa430d2468d6 to your computer and use it in GitHub Desktop.
Rspec | named_let は match_array / contain_exactly には効かない ref: http://qiita.com/Yinaura/items/19feab1cfc184cdfbf00
rspec -fd test_spec.rb
should contain exactly #<Object:0x007fcb73c525b0> and #<Object:0x007fcb73c52588>
Finished in 0.90819 seconds (files took 11.2 seconds to load)
1 example, 0 failures
require 'spec_helper'
describe do
subject { [Object.new, Object.new] }
named_let(:instances) { subject }
it { should contain_exactly(*instances) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment