Sha256: a5246e783832b30e923a8f2536d51098ae1ff56f08f84d5277fc324f49487886
Contents?: true
Size: 652 Bytes
Versions: 1
Compression:
Stored size: 652 Bytes
Contents
shared_examples_for "object with style" do it "merges new styles" do old_style = subject.style subject.style :left => 100 subject.style :top => 50 expect(subject.style).to eq(old_style.merge(:left => 100, :top => 50)) end describe 'changing style' do before do subject.stub(:update_style) end it 'calls change_style when the style is changed' do subject.style :left => 50 expect(subject).to have_received(:update_style) end it 'does not call change_style when style is called without args' do subject.style expect(subject).not_to have_received(:update_style) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
shoes-4.0.0.pre1 | spec/shoes/shared_examples/style.rb |