[rubygem-hipchat] Update to hipchat 1.4.0 (RHBZ #1129087)

Ken Dreyer ktdreyer at fedoraproject.org
Fri Nov 21 16:06:00 UTC 2014


commit df7df216bb03ecc6d715d61eb2a4d5788232210c
Author: Ken Dreyer <ktdreyer at ktdreyer.com>
Date:   Fri Nov 21 09:05:38 2014 -0700

    Update to hipchat 1.4.0 (RHBZ #1129087)
    
    - Drop json/spec_helper change (was merged upstream)
    - Submit "make coveralls optional" patch for inclusion upstream
    - Conditionally patch for rspec 3
    - Use %license macro

 .gitignore                                |    1 +
 rubygem-hipchat-1.4.0-coveralls.patch     |   37 ++
 rubygem-hipchat-1.4.0-rspec3-expect.patch |  503 ++++++++++++++++++++++++++++
 rubygem-hipchat-1.4.0-rspec3.patch        |  512 +++++++++++++++++++++++++++++
 rubygem-hipchat.spec                      |   42 ++-
 sources                                   |    2 +-
 6 files changed, 1083 insertions(+), 14 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index d655e49..df8d122 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 /hipchat-1.0.1.gem
 /hipchat-1.1.0.gem
 /hipchat-1.2.0.gem
+/hipchat-1.4.0.gem
diff --git a/rubygem-hipchat-1.4.0-coveralls.patch b/rubygem-hipchat-1.4.0-coveralls.patch
new file mode 100644
index 0000000..f7dad82
--- /dev/null
+++ b/rubygem-hipchat-1.4.0-coveralls.patch
@@ -0,0 +1,37 @@
+From 8031ab3e6d7a28377ee88a5a04f44d1ceccf10a1 Mon Sep 17 00:00:00 2001
+From: Ken Dreyer <ktdreyer at ktdreyer.com>
+Date: Thu, 20 Nov 2014 17:38:03 -0700
+Subject: [PATCH] tests: make coveralls optional
+
+If we do not have Coveralls installed, we should be able to continue
+with the rest of the test suite.
+
+This allows the tests to run outside of Bundler if Coveralls is not
+installed.
+---
+ spec/spec_helper.rb | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
+index 4e07fbb..e6f4b4b 100644
+--- a/spec/spec_helper.rb
++++ b/spec/spec_helper.rb
+@@ -5,9 +5,13 @@ require 'rspec'
+ require 'rspec/autorun'
+ require 'json'
+ require 'webmock/rspec'
+-require 'coveralls'
+ 
+-Coveralls.wear!
++begin
++  require 'coveralls'
++  Coveralls.wear!
++rescue LoadError
++  warn 'warning: coveralls gem not found; skipping coverage'
++end
+ 
+ Dir["./spec/support/**/*.rb"].each {|f| require f}
+ 
+-- 
+1.9.3
+
diff --git a/rubygem-hipchat-1.4.0-rspec3-expect.patch b/rubygem-hipchat-1.4.0-rspec3-expect.patch
new file mode 100644
index 0000000..f821308
--- /dev/null
+++ b/rubygem-hipchat-1.4.0-rspec3-expect.patch
@@ -0,0 +1,503 @@
+From 434c75ee34b9df91a5d2a0bed2bb072d41752228 Mon Sep 17 00:00:00 2001
+From: Ken Dreyer <ktdreyer at ktdreyer.com>
+Date: Thu, 20 Nov 2014 19:56:48 -0700
+Subject: [PATCH] tests: use rspec3 "expect" syntax
+
+---
+ spec/hipchat_api_v1_spec.rb | 53 ++++++++++++++----------------
+ spec/hipchat_api_v2_spec.rb | 78 +++++++++++++++++++++------------------------
+ 2 files changed, 61 insertions(+), 70 deletions(-)
+
+diff --git a/spec/hipchat_api_v1_spec.rb b/spec/hipchat_api_v1_spec.rb
+index c55afac..23e42de 100644
+--- a/spec/hipchat_api_v1_spec.rb
++++ b/spec/hipchat_api_v1_spec.rb
+@@ -11,20 +11,20 @@ describe "HipChat (API V1)" do
+     it "is successful without custom options" do
+       mock_successful_history()
+ 
+-      room.history().should be_truthy
++      expect(room.history()).to be_truthy
+     end
+ 
+     it "is successful with custom options" do
+       mock_successful_history(:timezone => 'America/Los_Angeles', :date => '2010-11-19')
+-      room.history(:timezone => 'America/Los_Angeles', :date => '2010-11-19').should be_truthy
++      expect(room.history(:timezone => 'America/Los_Angeles', :date => '2010-11-19')).to be_truthy
+     end
+ 
+     it "is successful from fetched room" do
+       mock_successful_rooms
+       mock_successful_history
+ 
+-      subject.rooms.should be_truthy
+-      subject.rooms.first.history.should be_truthy
++      expect(subject.rooms).to be_truthy
++      expect(subject.rooms.first.history).to be_truthy
+     end
+ 
+     it "fails when the room doen't exist" do
+@@ -32,7 +32,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { room.history }.should raise_error(HipChat::UnknownRoom)
++      expect { room.history }.to raise_error(HipChat::UnknownRoom)
+     end
+ 
+     it "fails when we're not allowed to do so" do
+@@ -40,7 +40,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 401)
+       }
+ 
+-      lambda { room.history }.should raise_error(HipChat::Unauthorized)
++      expect { room.history }.to raise_error(HipChat::Unauthorized)
+     end
+ 
+     it "fails if we get an unknown response code" do
+@@ -48,8 +48,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 403)
+       }
+ 
+-      lambda { room.history }.
+-        should raise_error(HipChat::UnknownResponseCode)
++      expect { room.history }.to raise_error(HipChat::UnknownResponseCode)
+     end
+   end
+ 
+@@ -58,13 +57,13 @@ describe "HipChat (API V1)" do
+     it "is successful without custom options" do
+       mock_successful_topic_change("Nice topic")
+ 
+-      room.topic("Nice topic").should be_truthy
++      expect(room.topic("Nice topic")).to be_truthy
+     end
+ 
+     it "is successful with a custom from" do
+       mock_successful_topic_change("Nice topic", :from => "Me")
+ 
+-      room.topic("Nice topic", :from => "Me").should be_truthy
++      expect(room.topic("Nice topic", :from => "Me")).to be_truthy
+     end
+ 
+     it "fails when the room doesn't exist" do
+@@ -72,7 +71,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { room.topic "" }.should raise_error(HipChat::UnknownRoom)
++      expect { room.topic "" }.to raise_error(HipChat::UnknownRoom)
+     end
+ 
+     it "fails when we're not allowed to do so" do
+@@ -80,7 +79,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 401)
+       }
+ 
+-      lambda { room.topic "" }.should raise_error(HipChat::Unauthorized)
++      expect { room.topic "" }.to raise_error(HipChat::Unauthorized)
+     end
+ 
+     it "fails if we get an unknown response code" do
+@@ -88,8 +87,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 403)
+       }
+ 
+-      lambda { room.topic "" }.
+-        should raise_error(HipChat::UnknownResponseCode)
++      expect { room.topic "" }.to raise_error(HipChat::UnknownResponseCode)
+     end
+   end
+ 
+@@ -98,25 +96,25 @@ describe "HipChat (API V1)" do
+     it "successfully without custom options" do
+       mock_successful_send 'Dude', 'Hello world'
+ 
+-      room.send("Dude", "Hello world").should be_truthy
++      expect(room.send("Dude", "Hello world")).to be_truthy
+     end
+ 
+     it "successfully with notifications on as option" do
+       mock_successful_send 'Dude', 'Hello world', :notify => 1
+ 
+-      room.send("Dude", "Hello world", :notify => 1).should be_truthy
++      expect(room.send("Dude", "Hello world", :notify => 1)).to be_truthy
+     end
+ 
+     it "successfully with custom color" do
+       mock_successful_send 'Dude', 'Hello world', :color => 'red'
+ 
+-      room.send("Dude", "Hello world", :color => 'red').should be_truthy
++      expect(room.send("Dude", "Hello world", :color => 'red')).to be_truthy
+     end
+ 
+     it "successfully with text message_format" do
+       mock_successful_send 'Dude', 'Hello world', :message_format => 'text'
+ 
+-      room.send("Dude", "Hello world", :message_format => 'text').should be_truthy
++      expect(room.send("Dude", "Hello world", :message_format => 'text')).to be_truthy
+     end
+ 
+     it "but fails when the room doesn't exist" do
+@@ -124,7 +122,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { room.send "", "" }.should raise_error(HipChat::UnknownRoom)
++      expect { room.send "", "" }.to raise_error(HipChat::UnknownRoom)
+     end
+ 
+     it "but fails when we're not allowed to do so" do
+@@ -132,11 +130,11 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 401)
+       }
+ 
+-      lambda { room.send "", "" }.should raise_error(HipChat::Unauthorized)
++      expect { room.send "", "" }.to raise_error(HipChat::Unauthorized)
+     end
+ 
+     it "but fails if the username is more than 15 chars" do
+-      lambda { room.send "a very long username here", "a message" }.should raise_error(HipChat::UsernameTooLong)
++      expect { room.send "a very long username here", "a message" }.to raise_error(HipChat::UsernameTooLong)
+     end
+ 
+     it "but fails if we get an unknown response code" do
+@@ -144,8 +142,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 403)
+       }
+ 
+-      lambda { room.send "", "" }.
+-        should raise_error(HipChat::UnknownResponseCode)
++      expect { room.send "", "" }.to raise_error(HipChat::UnknownResponseCode)
+     end
+   end
+ 
+@@ -155,26 +152,24 @@ describe "HipChat (API V1)" do
+     it "successfully with room name" do
+       mock_successful_room_creation("A Room", :owner_user_id => "123456")
+ 
+-      subject.create_room("A Room", {:owner_user_id => "123456"}).should be_truthy
++      expect(subject.create_room("A Room", {:owner_user_id => "123456"})).to be_truthy
+     end
+ 
+     it "successfully with custom parameters" do
+       mock_successful_room_creation("A Room", {:owner_user_id => "123456", :privacy => "private", :guest_access => "1"})
+ 
+-      subject.create_room("A Room", {:owner_user_id => "123456", :privacy => "private", :guest_access =>true}).should be_truthy
++      expect(subject.create_room("A Room", {:owner_user_id => "123456", :privacy => "private", :guest_access =>true})).to be_truthy
+     end
+ 
+     it "but fails if we dont pass owner_user_id" do
+-      lambda { subject.create_room("A Room", {:privacy => "private", :guest_access =>true}) }.
+-        should raise_error(HipChat::RoomMissingOwnerUserId)
++      expect { subject.create_room("A Room", {:privacy => "private", :guest_access =>true}) }.to raise_error(HipChat::RoomMissingOwnerUserId)
+     end
+   end
+ 
+   describe "#send user message" do
+     it "fails because API V1 doesn't support user operations" do
+ 
+-      lambda { HipChat::Client.new("blah", :api_version => @api_version).user('12345678') }.
+-        should raise_error(HipChat::InvalidApiVersion)
++      expect { HipChat::Client.new("blah", :api_version => @api_version).user('12345678') }.to raise_error(HipChat::InvalidApiVersion)
+     end
+   end
+ end
+diff --git a/spec/hipchat_api_v2_spec.rb b/spec/hipchat_api_v2_spec.rb
+index 221e7d9..9e20c0a 100644
+--- a/spec/hipchat_api_v2_spec.rb
++++ b/spec/hipchat_api_v2_spec.rb
+@@ -12,20 +12,20 @@ describe "HipChat (API V2)" do
+     it "is successful without custom options" do
+       mock_successful_history()
+ 
+-      room.history().should be_truthy
++      expect(room.history()).to be_truthy
+     end
+ 
+     it "is successful with custom options" do
+       mock_successful_history(:timezone => 'America/Los_Angeles', :date => '2010-11-19')
+-      room.history(:timezone => 'America/Los_Angeles', :date => '2010-11-19').should be_truthy
++      expect(room.history(:timezone => 'America/Los_Angeles', :date => '2010-11-19')).to be_truthy
+     end
+ 
+     it "is successful from fetched room" do
+       mock_successful_rooms
+       mock_successful_history
+ 
+-      subject.rooms.should be_truthy
+-      subject.rooms.first.history.should be_truthy
++      expect(subject.rooms).to be_truthy
++      expect(subject.rooms.first.history).to be_truthy
+     end
+ 
+     it "fails when the room doen't exist" do
+@@ -33,7 +33,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { room.history }.should raise_error(HipChat::UnknownRoom)
++      expect { room.history }.to raise_error(HipChat::UnknownRoom)
+     end
+ 
+     it "fails when we're not allowed to do so" do
+@@ -41,7 +41,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 401)
+       }
+ 
+-      lambda { room.history }.should raise_error(HipChat::Unauthorized)
++      expect { room.history }.to raise_error(HipChat::Unauthorized)
+     end
+ 
+     it "fails if we get an unknown response code" do
+@@ -49,8 +49,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 403)
+       }
+ 
+-      lambda { room.history }.
+-        should raise_error(HipChat::UnknownResponseCode)
++      expect { room.history }.to raise_error(HipChat::UnknownResponseCode)
+     end
+   end
+ 
+@@ -59,15 +58,15 @@ describe "HipChat (API V2)" do
+     it "is successful without custom options" do
+       mock_successful_statistics
+ 
+-      room.statistics().should be_truthy
++      expect(room.statistics()).to be_truthy
+     end
+ 
+     it "is successful from fetched room" do
+       mock_successful_rooms
+       mock_successful_statistics
+ 
+-      subject.rooms.should be_truthy
+-      subject.rooms.first.statistics.should be_truthy
++      expect(subject.rooms).to be_truthy
++      expect(subject.rooms.first.statistics).to be_truthy
+     end
+ 
+     it "fails when the room doen't exist" do
+@@ -75,7 +74,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { room.statistics }.should raise_error(HipChat::UnknownRoom)
++      expect { room.statistics }.to raise_error(HipChat::UnknownRoom)
+     end
+ 
+     it "fails when we're not allowed to do so" do
+@@ -83,7 +82,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 401)
+       }
+ 
+-      lambda { room.statistics }.should raise_error(HipChat::Unauthorized)
++      expect { room.statistics }.to raise_error(HipChat::Unauthorized)
+     end
+ 
+     it "fails if we get an unknown response code" do
+@@ -91,8 +90,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 403)
+       }
+ 
+-      lambda { room.statistics }.
+-        should raise_error(HipChat::UnknownResponseCode)
++      expect { room.statistics }.to raise_error(HipChat::UnknownResponseCode)
+     end 
+   end
+ 
+@@ -101,13 +99,13 @@ describe "HipChat (API V2)" do
+     it "is successful without custom options" do
+       mock_successful_topic_change("Nice topic")
+ 
+-      room.topic("Nice topic").should be_truthy
++      expect(room.topic("Nice topic")).to be_truthy
+     end
+ 
+     it "is successful with a custom from" do
+       mock_successful_topic_change("Nice topic", :from => "Me")
+ 
+-      room.topic("Nice topic", :from => "Me").should be_truthy
++      expect(room.topic("Nice topic", :from => "Me")).to be_truthy
+     end
+ 
+     it "fails when the room doesn't exist" do
+@@ -115,7 +113,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { room.topic "" }.should raise_error(HipChat::UnknownRoom)
++      expect { room.topic "" }.to raise_error(HipChat::UnknownRoom)
+     end
+ 
+     it "fails when we're not allowed to do so" do
+@@ -123,7 +121,7 @@ describe "HipChat (API V2)" do
+           OpenStruct.new(:code => 401)
+         }
+ 
+-      lambda { room.topic "" }.should raise_error(HipChat::Unauthorized)
++      expect { room.topic "" }.to raise_error(HipChat::Unauthorized)
+     end
+ 
+     it "fails if we get an unknown response code" do
+@@ -131,8 +129,7 @@ describe "HipChat (API V2)" do
+           OpenStruct.new(:code => 403)
+         }
+ 
+-      lambda { room.topic "" }.
+-        should raise_error(HipChat::UnknownResponseCode)
++      expect { room.topic "" }.to raise_error(HipChat::UnknownResponseCode)
+     end
+   end
+ 
+@@ -141,25 +138,25 @@ describe "HipChat (API V2)" do
+     it "successfully without custom options" do
+       mock_successful_send 'Dude', 'Hello world'
+ 
+-      room.send("Dude", "Hello world").should be_truthy
++      expect(room.send("Dude", "Hello world")).to be_truthy
+     end
+ 
+     it "successfully with notifications on as option" do
+       mock_successful_send 'Dude', 'Hello world', :notify => true
+ 
+-      room.send("Dude", "Hello world", :notify => true).should be_truthy
++      expect(room.send("Dude", "Hello world", :notify => true)).to be_truthy
+     end
+ 
+     it "successfully with custom color" do
+       mock_successful_send 'Dude', 'Hello world', :color => 'red'
+ 
+-      room.send("Dude", "Hello world", :color => 'red').should be_truthy
++      expect(room.send("Dude", "Hello world", :color => 'red')).to be_truthy
+     end
+ 
+     it "successfully with text message_format" do
+       mock_successful_send 'Dude', 'Hello world', :message_format => 'text'
+ 
+-      room.send("Dude", "Hello world", :message_format => 'text').should be_truthy
++      expect(room.send("Dude", "Hello world", :message_format => 'text')).to be_truthy
+     end
+ 
+     it "but fails when the room doesn't exist" do
+@@ -167,7 +164,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { room.send "", "" }.should raise_error(HipChat::UnknownRoom)
++      expect { room.send "", "" }.to raise_error(HipChat::UnknownRoom)
+     end
+ 
+     it "but fails when we're not allowed to do so" do
+@@ -175,11 +172,11 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 401)
+       }
+ 
+-      lambda { room.send "", "" }.should raise_error(HipChat::Unauthorized)
++      expect { room.send "", "" }.to raise_error(HipChat::Unauthorized)
+     end
+ 
+     it "but fails if the username is more than 15 chars" do
+-      lambda { room.send "a very long username here", "a message" }.should raise_error(HipChat::UsernameTooLong)
++      expect { room.send "a very long username here", "a message" }.to raise_error(HipChat::UsernameTooLong)
+     end
+ 
+     it "but fails if we get an unknown response code" do
+@@ -187,8 +184,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 403)
+       }
+ 
+-      lambda { room.send "", "" }.
+-        should raise_error(HipChat::UnknownResponseCode)
++      expect { room.send "", "" }.to raise_error(HipChat::UnknownResponseCode)
+     end
+   end
+ 
+@@ -198,18 +194,18 @@ describe "HipChat (API V2)" do
+     it "successfully with room name" do
+       mock_successful_room_creation("A Room")
+ 
+-      subject.create_room("A Room").should be_truthy
++      expect(subject.create_room("A Room")).to be_truthy
+     end
+ 
+     it "successfully with custom parameters" do
+       mock_successful_room_creation("A Room", {:owner_user_id => "123456", :privacy => "private", :guest_access => true})
+ 
+-      subject.create_room("A Room", {:owner_user_id => "123456", :privacy => "private", :guest_access =>true}).should be_truthy
++      expect(subject.create_room("A Room", {:owner_user_id => "123456", :privacy => "private", :guest_access =>true})).to be_truthy
+     end
+ 
+     it "but fail is name is longer then 50 char" do
+-      lambda { subject.create_room("A Room that is too long that I should fail right now") }.
+-        should raise_error(HipChat::RoomNameTooLong)
++      expect { subject.create_room("A Room that is too long that I should fail right now") }.
++        to raise_error(HipChat::RoomNameTooLong)
+     end
+   end
+ 
+@@ -219,7 +215,7 @@ describe "HipChat (API V2)" do
+     it "successfully" do
+       mock_successful_get_room("Hipchat")
+ 
+-      room.get_room.should be_truthy
++      expect(room.get_room).to be_truthy
+     end
+ 
+   end
+@@ -238,7 +234,7 @@ describe "HipChat (API V2)" do
+     }
+     it "successfully" do 
+       mock_successful_update_room("Hipchat", room_info)
+-      room.update_room(room_info).should be_truthy
++      expect(room.update_room(room_info)).to be_truthy
+     end
+   end
+ 
+@@ -248,13 +244,13 @@ describe "HipChat (API V2)" do
+     it "successfully with user_id" do
+       mock_successful_invite()
+ 
+-      room.invite("1234").should be_truthy
++      expect(room.invite("1234")).to be_truthy
+     end
+ 
+     it "successfully with custom parameters" do
+       mock_successful_invite({:user_id => "321", :reason => "A great reason"})
+ 
+-      room.invite("321", "A great reason").should be_truthy
++      expect(room.invite("321", "A great reason")).to be_truthy
+     end
+   end
+ 
+@@ -263,7 +259,7 @@ describe "HipChat (API V2)" do
+     it "successfully with a standard message" do
+       mock_successful_user_send 'Equal bytes for everyone'
+ 
+-      user.send('Equal bytes for everyone').should be_truthy
++      expect(user.send('Equal bytes for everyone')).to be_truthy
+     end
+ 
+     it "but fails when the user doesn't exist" do
+@@ -271,7 +267,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { user.send "" }.should raise_error(HipChat::UnknownUser)
++      expect { user.send "" }.to raise_error(HipChat::UnknownUser)
+     end
+ 
+     it "but fails when we're not allowed to do so" do
+@@ -279,7 +275,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 401)
+       }
+ 
+-      lambda { user.send "" }.should raise_error(HipChat::Unauthorized)
++      expect { user.send "" }.to raise_error(HipChat::Unauthorized)
+     end
+   end
+ end
+-- 
+1.9.3
+
diff --git a/rubygem-hipchat-1.4.0-rspec3.patch b/rubygem-hipchat-1.4.0-rspec3.patch
new file mode 100644
index 0000000..fa67f4d
--- /dev/null
+++ b/rubygem-hipchat-1.4.0-rspec3.patch
@@ -0,0 +1,512 @@
+From e60e4febbdb8268119946592864cea7e418945af Mon Sep 17 00:00:00 2001
+From: Ken Dreyer <ktdreyer at ktdreyer.com>
+Date: Thu, 20 Nov 2014 22:09:50 -0700
+Subject: [PATCH] Fedora: tests: update for rspec 3
+
+Update the test suite to work with rspec 3. Specifically:
+
+* Switch "be_true" to "be_truthy".
+* Switch from the deprecated :should syntax to the :expect syntax.
+
+This is a Fedora-specific patch that omits the gemspec change (since we
+dynamically regenerate the spec file during the RPM build). The full
+patch has been submitted upstream at
+https://github.com/hipchat/hipchat-rb/pull/115
+---
+ spec/hipchat_api_v1_spec.rb | 53 ++++++++++++++----------------
+ spec/hipchat_api_v2_spec.rb | 78 +++++++++++++++++++++------------------------
+ 2 files changed, 61 insertions(+), 70 deletions(-)
+
+diff --git a/spec/hipchat_api_v1_spec.rb b/spec/hipchat_api_v1_spec.rb
+index 95a1b6e..23e42de 100644
+--- a/spec/hipchat_api_v1_spec.rb
++++ b/spec/hipchat_api_v1_spec.rb
+@@ -11,20 +11,20 @@ describe "HipChat (API V1)" do
+     it "is successful without custom options" do
+       mock_successful_history()
+ 
+-      room.history().should be_true
++      expect(room.history()).to be_truthy
+     end
+ 
+     it "is successful with custom options" do
+       mock_successful_history(:timezone => 'America/Los_Angeles', :date => '2010-11-19')
+-      room.history(:timezone => 'America/Los_Angeles', :date => '2010-11-19').should be_true
++      expect(room.history(:timezone => 'America/Los_Angeles', :date => '2010-11-19')).to be_truthy
+     end
+ 
+     it "is successful from fetched room" do
+       mock_successful_rooms
+       mock_successful_history
+ 
+-      subject.rooms.should be_true
+-      subject.rooms.first.history.should be_true
++      expect(subject.rooms).to be_truthy
++      expect(subject.rooms.first.history).to be_truthy
+     end
+ 
+     it "fails when the room doen't exist" do
+@@ -32,7 +32,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { room.history }.should raise_error(HipChat::UnknownRoom)
++      expect { room.history }.to raise_error(HipChat::UnknownRoom)
+     end
+ 
+     it "fails when we're not allowed to do so" do
+@@ -40,7 +40,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 401)
+       }
+ 
+-      lambda { room.history }.should raise_error(HipChat::Unauthorized)
++      expect { room.history }.to raise_error(HipChat::Unauthorized)
+     end
+ 
+     it "fails if we get an unknown response code" do
+@@ -48,8 +48,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 403)
+       }
+ 
+-      lambda { room.history }.
+-        should raise_error(HipChat::UnknownResponseCode)
++      expect { room.history }.to raise_error(HipChat::UnknownResponseCode)
+     end
+   end
+ 
+@@ -58,13 +57,13 @@ describe "HipChat (API V1)" do
+     it "is successful without custom options" do
+       mock_successful_topic_change("Nice topic")
+ 
+-      room.topic("Nice topic").should be_true
++      expect(room.topic("Nice topic")).to be_truthy
+     end
+ 
+     it "is successful with a custom from" do
+       mock_successful_topic_change("Nice topic", :from => "Me")
+ 
+-      room.topic("Nice topic", :from => "Me").should be_true
++      expect(room.topic("Nice topic", :from => "Me")).to be_truthy
+     end
+ 
+     it "fails when the room doesn't exist" do
+@@ -72,7 +71,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { room.topic "" }.should raise_error(HipChat::UnknownRoom)
++      expect { room.topic "" }.to raise_error(HipChat::UnknownRoom)
+     end
+ 
+     it "fails when we're not allowed to do so" do
+@@ -80,7 +79,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 401)
+       }
+ 
+-      lambda { room.topic "" }.should raise_error(HipChat::Unauthorized)
++      expect { room.topic "" }.to raise_error(HipChat::Unauthorized)
+     end
+ 
+     it "fails if we get an unknown response code" do
+@@ -88,8 +87,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 403)
+       }
+ 
+-      lambda { room.topic "" }.
+-        should raise_error(HipChat::UnknownResponseCode)
++      expect { room.topic "" }.to raise_error(HipChat::UnknownResponseCode)
+     end
+   end
+ 
+@@ -98,25 +96,25 @@ describe "HipChat (API V1)" do
+     it "successfully without custom options" do
+       mock_successful_send 'Dude', 'Hello world'
+ 
+-      room.send("Dude", "Hello world").should be_true
++      expect(room.send("Dude", "Hello world")).to be_truthy
+     end
+ 
+     it "successfully with notifications on as option" do
+       mock_successful_send 'Dude', 'Hello world', :notify => 1
+ 
+-      room.send("Dude", "Hello world", :notify => 1).should be_true
++      expect(room.send("Dude", "Hello world", :notify => 1)).to be_truthy
+     end
+ 
+     it "successfully with custom color" do
+       mock_successful_send 'Dude', 'Hello world', :color => 'red'
+ 
+-      room.send("Dude", "Hello world", :color => 'red').should be_true
++      expect(room.send("Dude", "Hello world", :color => 'red')).to be_truthy
+     end
+ 
+     it "successfully with text message_format" do
+       mock_successful_send 'Dude', 'Hello world', :message_format => 'text'
+ 
+-      room.send("Dude", "Hello world", :message_format => 'text').should be_true
++      expect(room.send("Dude", "Hello world", :message_format => 'text')).to be_truthy
+     end
+ 
+     it "but fails when the room doesn't exist" do
+@@ -124,7 +122,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { room.send "", "" }.should raise_error(HipChat::UnknownRoom)
++      expect { room.send "", "" }.to raise_error(HipChat::UnknownRoom)
+     end
+ 
+     it "but fails when we're not allowed to do so" do
+@@ -132,11 +130,11 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 401)
+       }
+ 
+-      lambda { room.send "", "" }.should raise_error(HipChat::Unauthorized)
++      expect { room.send "", "" }.to raise_error(HipChat::Unauthorized)
+     end
+ 
+     it "but fails if the username is more than 15 chars" do
+-      lambda { room.send "a very long username here", "a message" }.should raise_error(HipChat::UsernameTooLong)
++      expect { room.send "a very long username here", "a message" }.to raise_error(HipChat::UsernameTooLong)
+     end
+ 
+     it "but fails if we get an unknown response code" do
+@@ -144,8 +142,7 @@ describe "HipChat (API V1)" do
+         OpenStruct.new(:code => 403)
+       }
+ 
+-      lambda { room.send "", "" }.
+-        should raise_error(HipChat::UnknownResponseCode)
++      expect { room.send "", "" }.to raise_error(HipChat::UnknownResponseCode)
+     end
+   end
+ 
+@@ -155,26 +152,24 @@ describe "HipChat (API V1)" do
+     it "successfully with room name" do
+       mock_successful_room_creation("A Room", :owner_user_id => "123456")
+ 
+-      subject.create_room("A Room", {:owner_user_id => "123456"}).should be_true
++      expect(subject.create_room("A Room", {:owner_user_id => "123456"})).to be_truthy
+     end
+ 
+     it "successfully with custom parameters" do
+       mock_successful_room_creation("A Room", {:owner_user_id => "123456", :privacy => "private", :guest_access => "1"})
+ 
+-      subject.create_room("A Room", {:owner_user_id => "123456", :privacy => "private", :guest_access =>true}).should be_true
++      expect(subject.create_room("A Room", {:owner_user_id => "123456", :privacy => "private", :guest_access =>true})).to be_truthy
+     end
+ 
+     it "but fails if we dont pass owner_user_id" do
+-      lambda { subject.create_room("A Room", {:privacy => "private", :guest_access =>true}) }.
+-        should raise_error(HipChat::RoomMissingOwnerUserId)
++      expect { subject.create_room("A Room", {:privacy => "private", :guest_access =>true}) }.to raise_error(HipChat::RoomMissingOwnerUserId)
+     end
+   end
+ 
+   describe "#send user message" do
+     it "fails because API V1 doesn't support user operations" do
+ 
+-      lambda { HipChat::Client.new("blah", :api_version => @api_version).user('12345678') }.
+-        should raise_error(HipChat::InvalidApiVersion)
++      expect { HipChat::Client.new("blah", :api_version => @api_version).user('12345678') }.to raise_error(HipChat::InvalidApiVersion)
+     end
+   end
+ end
+diff --git a/spec/hipchat_api_v2_spec.rb b/spec/hipchat_api_v2_spec.rb
+index 5ca31c1..9e20c0a 100644
+--- a/spec/hipchat_api_v2_spec.rb
++++ b/spec/hipchat_api_v2_spec.rb
+@@ -12,20 +12,20 @@ describe "HipChat (API V2)" do
+     it "is successful without custom options" do
+       mock_successful_history()
+ 
+-      room.history().should be_true
++      expect(room.history()).to be_truthy
+     end
+ 
+     it "is successful with custom options" do
+       mock_successful_history(:timezone => 'America/Los_Angeles', :date => '2010-11-19')
+-      room.history(:timezone => 'America/Los_Angeles', :date => '2010-11-19').should be_true
++      expect(room.history(:timezone => 'America/Los_Angeles', :date => '2010-11-19')).to be_truthy
+     end
+ 
+     it "is successful from fetched room" do
+       mock_successful_rooms
+       mock_successful_history
+ 
+-      subject.rooms.should be_true
+-      subject.rooms.first.history.should be_true
++      expect(subject.rooms).to be_truthy
++      expect(subject.rooms.first.history).to be_truthy
+     end
+ 
+     it "fails when the room doen't exist" do
+@@ -33,7 +33,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { room.history }.should raise_error(HipChat::UnknownRoom)
++      expect { room.history }.to raise_error(HipChat::UnknownRoom)
+     end
+ 
+     it "fails when we're not allowed to do so" do
+@@ -41,7 +41,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 401)
+       }
+ 
+-      lambda { room.history }.should raise_error(HipChat::Unauthorized)
++      expect { room.history }.to raise_error(HipChat::Unauthorized)
+     end
+ 
+     it "fails if we get an unknown response code" do
+@@ -49,8 +49,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 403)
+       }
+ 
+-      lambda { room.history }.
+-        should raise_error(HipChat::UnknownResponseCode)
++      expect { room.history }.to raise_error(HipChat::UnknownResponseCode)
+     end
+   end
+ 
+@@ -59,15 +58,15 @@ describe "HipChat (API V2)" do
+     it "is successful without custom options" do
+       mock_successful_statistics
+ 
+-      room.statistics().should be_true
++      expect(room.statistics()).to be_truthy
+     end
+ 
+     it "is successful from fetched room" do
+       mock_successful_rooms
+       mock_successful_statistics
+ 
+-      subject.rooms.should be_true
+-      subject.rooms.first.statistics.should be_true
++      expect(subject.rooms).to be_truthy
++      expect(subject.rooms.first.statistics).to be_truthy
+     end
+ 
+     it "fails when the room doen't exist" do
+@@ -75,7 +74,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { room.statistics }.should raise_error(HipChat::UnknownRoom)
++      expect { room.statistics }.to raise_error(HipChat::UnknownRoom)
+     end
+ 
+     it "fails when we're not allowed to do so" do
+@@ -83,7 +82,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 401)
+       }
+ 
+-      lambda { room.statistics }.should raise_error(HipChat::Unauthorized)
++      expect { room.statistics }.to raise_error(HipChat::Unauthorized)
+     end
+ 
+     it "fails if we get an unknown response code" do
+@@ -91,8 +90,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 403)
+       }
+ 
+-      lambda { room.statistics }.
+-        should raise_error(HipChat::UnknownResponseCode)
++      expect { room.statistics }.to raise_error(HipChat::UnknownResponseCode)
+     end 
+   end
+ 
+@@ -101,13 +99,13 @@ describe "HipChat (API V2)" do
+     it "is successful without custom options" do
+       mock_successful_topic_change("Nice topic")
+ 
+-      room.topic("Nice topic").should be_true
++      expect(room.topic("Nice topic")).to be_truthy
+     end
+ 
+     it "is successful with a custom from" do
+       mock_successful_topic_change("Nice topic", :from => "Me")
+ 
+-      room.topic("Nice topic", :from => "Me").should be_true
++      expect(room.topic("Nice topic", :from => "Me")).to be_truthy
+     end
+ 
+     it "fails when the room doesn't exist" do
+@@ -115,7 +113,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { room.topic "" }.should raise_error(HipChat::UnknownRoom)
++      expect { room.topic "" }.to raise_error(HipChat::UnknownRoom)
+     end
+ 
+     it "fails when we're not allowed to do so" do
+@@ -123,7 +121,7 @@ describe "HipChat (API V2)" do
+           OpenStruct.new(:code => 401)
+         }
+ 
+-      lambda { room.topic "" }.should raise_error(HipChat::Unauthorized)
++      expect { room.topic "" }.to raise_error(HipChat::Unauthorized)
+     end
+ 
+     it "fails if we get an unknown response code" do
+@@ -131,8 +129,7 @@ describe "HipChat (API V2)" do
+           OpenStruct.new(:code => 403)
+         }
+ 
+-      lambda { room.topic "" }.
+-        should raise_error(HipChat::UnknownResponseCode)
++      expect { room.topic "" }.to raise_error(HipChat::UnknownResponseCode)
+     end
+   end
+ 
+@@ -141,25 +138,25 @@ describe "HipChat (API V2)" do
+     it "successfully without custom options" do
+       mock_successful_send 'Dude', 'Hello world'
+ 
+-      room.send("Dude", "Hello world").should be_true
++      expect(room.send("Dude", "Hello world")).to be_truthy
+     end
+ 
+     it "successfully with notifications on as option" do
+       mock_successful_send 'Dude', 'Hello world', :notify => true
+ 
+-      room.send("Dude", "Hello world", :notify => true).should be_true
++      expect(room.send("Dude", "Hello world", :notify => true)).to be_truthy
+     end
+ 
+     it "successfully with custom color" do
+       mock_successful_send 'Dude', 'Hello world', :color => 'red'
+ 
+-      room.send("Dude", "Hello world", :color => 'red').should be_true
++      expect(room.send("Dude", "Hello world", :color => 'red')).to be_truthy
+     end
+ 
+     it "successfully with text message_format" do
+       mock_successful_send 'Dude', 'Hello world', :message_format => 'text'
+ 
+-      room.send("Dude", "Hello world", :message_format => 'text').should be_true
++      expect(room.send("Dude", "Hello world", :message_format => 'text')).to be_truthy
+     end
+ 
+     it "but fails when the room doesn't exist" do
+@@ -167,7 +164,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { room.send "", "" }.should raise_error(HipChat::UnknownRoom)
++      expect { room.send "", "" }.to raise_error(HipChat::UnknownRoom)
+     end
+ 
+     it "but fails when we're not allowed to do so" do
+@@ -175,11 +172,11 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 401)
+       }
+ 
+-      lambda { room.send "", "" }.should raise_error(HipChat::Unauthorized)
++      expect { room.send "", "" }.to raise_error(HipChat::Unauthorized)
+     end
+ 
+     it "but fails if the username is more than 15 chars" do
+-      lambda { room.send "a very long username here", "a message" }.should raise_error(HipChat::UsernameTooLong)
++      expect { room.send "a very long username here", "a message" }.to raise_error(HipChat::UsernameTooLong)
+     end
+ 
+     it "but fails if we get an unknown response code" do
+@@ -187,8 +184,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 403)
+       }
+ 
+-      lambda { room.send "", "" }.
+-        should raise_error(HipChat::UnknownResponseCode)
++      expect { room.send "", "" }.to raise_error(HipChat::UnknownResponseCode)
+     end
+   end
+ 
+@@ -198,18 +194,18 @@ describe "HipChat (API V2)" do
+     it "successfully with room name" do
+       mock_successful_room_creation("A Room")
+ 
+-      subject.create_room("A Room").should be_true
++      expect(subject.create_room("A Room")).to be_truthy
+     end
+ 
+     it "successfully with custom parameters" do
+       mock_successful_room_creation("A Room", {:owner_user_id => "123456", :privacy => "private", :guest_access => true})
+ 
+-      subject.create_room("A Room", {:owner_user_id => "123456", :privacy => "private", :guest_access =>true}).should be_true
++      expect(subject.create_room("A Room", {:owner_user_id => "123456", :privacy => "private", :guest_access =>true})).to be_truthy
+     end
+ 
+     it "but fail is name is longer then 50 char" do
+-      lambda { subject.create_room("A Room that is too long that I should fail right now") }.
+-        should raise_error(HipChat::RoomNameTooLong)
++      expect { subject.create_room("A Room that is too long that I should fail right now") }.
++        to raise_error(HipChat::RoomNameTooLong)
+     end
+   end
+ 
+@@ -219,7 +215,7 @@ describe "HipChat (API V2)" do
+     it "successfully" do
+       mock_successful_get_room("Hipchat")
+ 
+-      room.get_room.should be_true
++      expect(room.get_room).to be_truthy
+     end
+ 
+   end
+@@ -238,7 +234,7 @@ describe "HipChat (API V2)" do
+     }
+     it "successfully" do 
+       mock_successful_update_room("Hipchat", room_info)
+-      room.update_room(room_info).should be_true
++      expect(room.update_room(room_info)).to be_truthy
+     end
+   end
+ 
+@@ -248,13 +244,13 @@ describe "HipChat (API V2)" do
+     it "successfully with user_id" do
+       mock_successful_invite()
+ 
+-      room.invite("1234").should be_true
++      expect(room.invite("1234")).to be_truthy
+     end
+ 
+     it "successfully with custom parameters" do
+       mock_successful_invite({:user_id => "321", :reason => "A great reason"})
+ 
+-      room.invite("321", "A great reason").should be_true
++      expect(room.invite("321", "A great reason")).to be_truthy
+     end
+   end
+ 
+@@ -263,7 +259,7 @@ describe "HipChat (API V2)" do
+     it "successfully with a standard message" do
+       mock_successful_user_send 'Equal bytes for everyone'
+ 
+-      user.send('Equal bytes for everyone').should be_true
++      expect(user.send('Equal bytes for everyone')).to be_truthy
+     end
+ 
+     it "but fails when the user doesn't exist" do
+@@ -271,7 +267,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 404)
+       }
+ 
+-      lambda { user.send "" }.should raise_error(HipChat::UnknownUser)
++      expect { user.send "" }.to raise_error(HipChat::UnknownUser)
+     end
+ 
+     it "but fails when we're not allowed to do so" do
+@@ -279,7 +275,7 @@ describe "HipChat (API V2)" do
+         OpenStruct.new(:code => 401)
+       }
+ 
+-      lambda { user.send "" }.should raise_error(HipChat::Unauthorized)
++      expect { user.send "" }.to raise_error(HipChat::Unauthorized)
+     end
+   end
+ end
+-- 
+1.9.3
+
diff --git a/rubygem-hipchat.spec b/rubygem-hipchat.spec
index 55a4d25..57512d6 100644
--- a/rubygem-hipchat.spec
+++ b/rubygem-hipchat.spec
@@ -1,13 +1,19 @@
 %global gem_name hipchat
 
 Name: rubygem-%{gem_name}
-Version: 1.2.0
-Release: 2%{?dist}
+Version: 1.4.0
+Release: 1%{?dist}
 Summary: Ruby library to interact with HipChat
 Group: Development/Languages
 License: MIT
 URL: https://github.com/hipchat/hipchat-rb
 Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
+# Remove dependency on coveralls. Submitted upstream:
+# https://github.com/hipchat/hipchat-rb/pull/116
+Patch0: rubygem-hipchat-1.4.0-coveralls.patch
+# Port to rspec 3. Submitted upstream:
+# https://github.com/hipchat/hipchat-rb/pull/115
+Patch1: rubygem-hipchat-1.4.0-rspec3.patch
 %if 0%{?fc19} || 0%{?fc20} || 0%{?el7}
 Requires: ruby(release)
 Requires: ruby(rubygems)
@@ -46,18 +52,20 @@ gem unpack %{SOURCE0}
 gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
 
 # Remove developer-only files.
-for f in .document .gitignore .ruby-gemset .ruby-version .travis.yml \
-Gemfile Rakefile; do
+for f in .coveralls.yml .document .gitignore .ruby-gemset .ruby-version \
+.travis.yml Gemfile Rakefile; do
   rm $f
   sed -i "s|\"$f\",||g" %{gem_name}.gemspec
 done
 
 # Remove dependency on coveralls
-sed -i -e "/require 'coveralls'/d" -e "/Coveralls.wear!/d" spec/spec_helper.rb
-
-# Require json during tests
-# https://github.com/hipchat/hipchat-rb/pull/61
-sed -i "3irequire 'json'" spec/spec_helper.rb
+# https://github.com/hipchat/hipchat-rb/pull/116
+%patch0 -p1
+# Update for rspec 3
+# https://github.com/hipchat/hipchat-rb/pull/115
+%if 0%{?fedora} > 21 || 0%{?rhel} > 7
+%patch1 -p1
+%endif
 
 %build
 # Create the gem as gem install only works on a gem file
@@ -65,13 +73,13 @@ gem build %{gem_name}.gemspec
 
 %gem_install
 
-# remove unecessary gemspec
+# remove unnecessary gemspec
 rm .%{gem_instdir}/%{gem_name}.gemspec
 
 %install
 mkdir -p %{buildroot}%{gem_dir}
-cp -pa .%{gem_dir}/* \
-        %{buildroot}%{gem_dir}/
+cp -a .%{gem_dir}/* \
+       %{buildroot}%{gem_dir}/
 
 %check
 pushd .%{gem_instdir}
@@ -80,8 +88,9 @@ popd
 
 
 %files
+%{!?_licensedir:%global license %%doc}
 %dir %{gem_instdir}
-%doc %{gem_instdir}/LICENSE
+%license %{gem_instdir}/LICENSE
 %doc %{gem_instdir}/README.textile
 %{gem_libdir}
 %exclude %{gem_cache}
@@ -93,6 +102,13 @@ popd
 
 
 %changelog
+* Fri Nov 21 2014 Ken Dreyer <ktdreyer at ktdreyer.com> - 1.4.0-1
+- Update to hipchat 1.4.0 (RHBZ #1129087)
+- Drop json/spec_helper change (was merged upstream)
+- Submit "make coveralls optional" patch for inclusion upstream
+- Conditionally patch for rspec 3
+- Use %%license macro
+
 * Sun Jun 08 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.2.0-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 
diff --git a/sources b/sources
index dfb2612..1b3f474 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-c66dbcd827916396e0b6dbaaecab6cf9  hipchat-1.2.0.gem
+4ef736e363a378cf6e319c3212257024  hipchat-1.4.0.gem


More information about the scm-commits mailing list