spec/flirt/flirt_callback_spec.rb in flirt-0.0.1 vs spec/flirt/flirt_callback_spec.rb in flirt-0.0.2

- old
+ new

@@ -3,11 +3,11 @@ describe Flirt::Callback do before(:each) do Flirt.enable end - describe "when instantiated with an object and callback" do + describe "when instantiated with an object and callback name" do let(:listener) { Object.new } let(:callback_name) { :call_me } let(:callback) { Flirt::Callback.new object: listener, callback_name: callback_name } @@ -26,8 +26,13 @@ it "calls the callback with the event data" do expect(listener).to receive(callback_name).with(event_data) callback.call(event_data) end + end + + it "tests equality if object and callback are the same" do + other_callback = Flirt::Callback.new object: listener, callback_name: callback_name + expect(callback).to eq(other_callback) end end end \ No newline at end of file