spec/citeproc/item_spec.rb in citeproc-1.0.3 vs spec/citeproc/item_spec.rb in citeproc-1.0.4
- old
+ new
@@ -73,7 +73,19 @@
it 'copies all variables' do
expect(Item.new(:issued => 1976).dup[:issued].year).to eq(1976)
end
end
+
+ describe '#attribute?' do
+ it 'should not trigger an observable read' do
+ obs = Object.new
+ def obs.update
+ end
+ expect(obs).not_to receive(:update)
+ item = Item.new(:issued => 1976)
+ item.add_observer(obs)
+ item.attribute?(:issued)
+ end
+ end
end
end