named_let is a gem for Rspec. The symbol given to let displays the test result.
But.
Test content
require 'spec_helper' describe do subject { [Object.new, Object.new] } named_let(:instances) { subject } it { should contain_exactly(*instances) } end
result
rspec -fd test_spec.rb
Instead of the name given in named_let, the content (in this case, the instance is displayed as it is.
should contain exactly #<Object:0x007fcb73c525b0> and #<Object:0x007fcb73c52588> Finished in 0.90819 seconds (files took 11.2 seconds to load) 1 example, 0 failures
environment
- named_let (0.1.5)
- rspec-rails (3.1.0)
Original by
Rspec | named_let は match_array / contain_exactly には効かない
About
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。