spec/notifier_spec.rb in notifier-0.5.0 vs spec/notifier_spec.rb in notifier-0.5.1

- old
+ new

@@ -5,26 +5,26 @@ unsupport_all_notifiers Notifier.default_notifier = nil end it "retrieves list of supported notifiers" do - Notifier::Snarl.stub :supported? => true - Notifier::Knotify.stub :supported? => true + allow(Notifier::Snarl).to receive_messages :supported? => true + allow(Notifier::Knotify).to receive_messages :supported? => true expect(Notifier.supported_notifiers.size).to eql(3) end it "returns first available notifier" do - Notifier::Snarl.stub :supported? => true - Notifier::Knotify.stub :supported? => true + allow(Notifier::Snarl).to receive_messages :supported? => true + allow(Notifier::Knotify).to receive_messages :supported? => true expect(Notifier.notifier).to eql(Notifier::Snarl) end it "prefers default notifier" do - Notifier::Snarl.stub :supported? => true - Notifier::Knotify.stub :supported? => true + allow(Notifier::Snarl).to receive_messages :supported? => true + allow(Notifier::Knotify).to receive_messages :supported? => true Notifier.default_notifier = :knotify expect(Notifier.notifier).to eql(Notifier::Knotify) end @@ -34,12 +34,12 @@ :title => "Some title", :message => "Some message", :image => "image.png" } - Notifier::Snarl.stub :supported? => true - Notifier::Snarl.should_receive(:notify).with(params) + allow(Notifier::Snarl).to receive_messages :supported? => true + expect(Notifier::Snarl).to receive(:notify).with(params) Notifier.notify(params) end it "retrieves list of all notifiers" do @@ -55,10 +55,10 @@ expect(Notifier.from_name(:notify_send)).to eql(Notifier::NotifySend) expect(Notifier.from_name(:growl)).to eql(Notifier::Growl) end it "returns notifier by its name when supported" do - Notifier::Snarl.stub :supported? => true + allow(Notifier::Snarl).to receive_messages :supported? => true expect(Notifier.supported_notifier_from_name(:snarl)).to eql(Notifier::Snarl) end it "returns nil when have no supported notifiers" do expect(Notifier.supported_notifier_from_name(:snarl)).to be_nil