diff --git a/.travis.yml b/.travis.yml index e6331e4..e81fb4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,16 @@ language: ruby rvm: - 1.9.3 - - 2.0.0 - - jruby-19mode # JRuby in 1.9 mode -# uncomment this line if your project needs to run something other than `rake`: -# script: bundle exec rspec spec + - 2.0 + - 2.1 + - 2.2 + - ruby-head + - rbx-2 + - jruby-19mode + - jruby-head +matrix: + # allow failures for head builds + allow_failures: + - rvm: ruby-head + - rvm: jruby-head + fast_finish: true \ No newline at end of file diff --git a/spec/lib/pushmeup_spec.rb b/spec/lib/pushmeup_spec.rb index 80264af..a0610b5 100644 --- a/spec/lib/pushmeup_spec.rb +++ b/spec/lib/pushmeup_spec.rb @@ -3,14 +3,14 @@ describe Pushmeup do describe "APNS" do it "should have a APNS object" do - defined?(APNS).should_not be_false + expect(defined?(APNS)).to be_truthy end it "should not forget the APNS default parameters" do - APNS.host.should == "gateway.sandbox.push.apple.com" - APNS.port.should == 2195 - APNS.pem.should be_equal(nil) - APNS.pass.should be_equal(nil) + expect(APNS.host).to eq("gateway.sandbox.push.apple.com") + expect(APNS.port).to eq(2195) + expect(APNS.pem).to be_nil + expect(APNS.pass).to be_nil end describe "Notifications" do @@ -20,7 +20,7 @@ it "should properly equate objects without caring about object identity" do a = APNS::Notification.new("123", {:alert => "hi"}) b = APNS::Notification.new("123", {:alert => "hi"}) - a.should eq(b) + expect(a).to eq(b) end end @@ -31,7 +31,7 @@ describe "GCM" do it "should have a GCM object" do - defined?(GCM).should_not be_false + expect(defined?(GCM)).to be_truthy end describe "Notifications" do @@ -42,28 +42,28 @@ it "should allow only notifications with device_tokens as array" do n = GCM::Notification.new("id", @options) - n.device_tokens.is_a?(Array).should be_true + expect(n.device_tokens).to be_an(Array) n.device_tokens = ["a" "b", "c"] - n.device_tokens.is_a?(Array).should be_true + expect(n.device_tokens).to be_an(Array) n.device_tokens = "a" - n.device_tokens.is_a?(Array).should be_true + expect(n.device_tokens).to be_an(Array) end it "should allow only notifications with data as hash with :data root" do n = GCM::Notification.new("id", { :data => "data" }) - n.data.is_a?(Hash).should be_true - n.data.should == {:data => "data"} + expect(n.data).to be_a(Hash) + expect(n.data).to eq(:data => "data") n.data = {:a => ["a", "b", "c"]} - n.data.is_a?(Hash).should be_true - n.data.should == {:a => ["a", "b", "c"]} + expect(n.data).to be_a(Hash) + expect(n.data).to eq(:a => ["a", "b", "c"]) n.data = {:a => "a"} - n.data.is_a?(Hash).should be_true - n.data.should == {:a => "a"} + expect(n.data).to be_a(Hash) + expect(n.data).to eq(:a => "a") end describe "#==" do @@ -71,7 +71,7 @@ it "should properly equate objects without caring about object identity" do a = GCM::Notification.new("id", { :data => "data" }) b = GCM::Notification.new("id", { :data => "data" }) - a.should eq(b) + expect(a).to eq(b) end end