Skip to content

Commit

Permalink
Merge pull request #43 from yammer/update_gems
Browse files Browse the repository at this point in the history
Update Gem Versions
  • Loading branch information
tiabas committed Jan 23, 2016
2 parents c958404 + bf4e6ef commit aa33a82
Show file tree
Hide file tree
Showing 23 changed files with 87 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: ruby
rvm:
- 2.3.0
- 2.0.0
- 1.9.3
- 1.9.2

branches:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ group :test do
gem 'rspec', '>= 2.11'
gem 'simplecov', :require => false
gem 'coveralls', :require => false
gem 'webmock', '>= 1.10.1'
gem 'webmock', '>= 1.22.0'
end

gemspec
14 changes: 7 additions & 7 deletions lib/yammer/version.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Copyright (c) Microsoft Corporation
# All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
# THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
# WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE,
# FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
# FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.

# See the Apache Version 2.0 License for specific language governing
# permissions and limitations under the License.

module Yammer
class Version
MAJOR = 2 unless defined? Yammer::MAJOR
MINOR = 4 unless defined? Yammer::MINOR
PATCH = 1 unless defined? Yammer::PATCH
MINOR = 5 unless defined? Yammer::MINOR
PATCH = 0 unless defined? Yammer::PATCH
PRE = nil unless defined? Yammer::PRE

class << self
Expand Down
2 changes: 1 addition & 1 deletion spec/api/activity_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
email: '[email protected]'
}]
}
subject.should_receive(:post).with('/api/v1/activity', params)
expect(subject).to receive(:post).with('/api/v1/activity', params)
@client.create_activity(params)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/api/autocomplete_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

describe '#autocomplete' do
it 'should fetch autocomplete data' do
subject.should_receive(:get).with('/api/v1/autocomplete/ranked', { :prefix => 'alc' })
expect(subject).to receive(:get).with('/api/v1/autocomplete/ranked', { :prefix => 'alc' })
subject.autocomplete({ :prefix => 'alc' })
end
end
end
end
6 changes: 3 additions & 3 deletions spec/api/group_membership_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@

describe '#get_group_membership' do
it 'should fetch a group membership' do
subject.should_receive(:get).with('/api/v1/group_memberships/1')
expect(subject).to receive(:get).with('/api/v1/group_memberships/1')
subject.get_group_membership(1)
end
end

describe '#create_group_membership' do
it 'should create a group membership' do
subject.should_receive(:post).with('/api/v1/group_memberships', { :group_id => 2 })
expect(subject).to receive(:post).with('/api/v1/group_memberships', { :group_id => 2 })
subject.create_group_membership(2)
end
end
end
end
12 changes: 6 additions & 6 deletions spec/api/group_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,28 @@

describe '#all_groups' do
it 'should fetch all groups in network' do
subject.should_receive(:get).with('/api/v1/groups', {})
expect(subject).to receive(:get).with('/api/v1/groups', {})
subject.all_groups
end
end

describe '#groups_for_user' do
it 'should fetch all groups for user' do
subject.should_receive(:get).with('/api/v1/groups/for_user/2')
expect(subject).to receive(:get).with('/api/v1/groups/for_user/2')
subject.groups_for_user(2)
end
end

describe '#get_group' do
it 'should fetch a thread' do
subject.should_receive(:get).with('/api/v1/groups/1')
expect(subject).to receive(:get).with('/api/v1/groups/1')
subject.get_group(1)
end
end

describe '#create_group' do
it 'should fetch a thread' do
subject.should_receive(:post).with('/api/v1/groups', {
expect(subject).to receive(:post).with('/api/v1/groups', {
:name => 'my group',
:description => 'A test group',
:private => false
Expand All @@ -66,11 +66,11 @@

describe '#update_group' do
it 'should fetch a thread' do
subject.should_receive(:post).with('/api/v1/groups/2', {
expect(subject).to receive(:post).with('/api/v1/groups/2', {
:name => 'another group',
:description => 'A modified group description',
})
subject.update_group(2, :name => 'another group', :description => 'A modified group description')
end
end
end
end
8 changes: 4 additions & 4 deletions spec/api/invitation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@

context 'with single email as string' do
it 'should invite users' do
subject.should_receive(:post).with('/api/v1/invitations', { :email => '[email protected]' })
expect(subject).to receive(:post).with('/api/v1/invitations', { :email => '[email protected]' })
subject.invite('[email protected] ')
end
end

context 'with single email as array' do
it 'should invite users' do
subject.should_receive(:post).with('/api/v1/invitations', { :email => '[email protected]' })
expect(subject).to receive(:post).with('/api/v1/invitations', { :email => '[email protected]' })
subject.invite(%w{[email protected]})
end
end

context 'with multiple emails as string' do
it 'should invite users' do
subject.should_receive(:post).with('/api/v1/invitations', { :email => '[email protected],[email protected]' })
expect(subject).to receive(:post).with('/api/v1/invitations', { :email => '[email protected],[email protected]' })
subject.invite(' [email protected],[email protected] ')
end
end

context 'with multiple emails as array' do
it 'should invite users' do
subject.should_receive(:post).with('/api/v1/invitations', { :email => '[email protected],[email protected]' })
expect(subject).to receive(:post).with('/api/v1/invitations', { :email => '[email protected],[email protected]' })
subject.invite(%w{ [email protected] [email protected] })
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/api/like_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@

describe '#likes' do
it 'should check if user likes open graph object' do
subject.should_receive(:get).with('/api/v1/likes/open_graph_object/1')
expect(subject).to receive(:get).with('/api/v1/likes/open_graph_object/1')
subject.likes_open_graph_object?(1)
end

it 'should like open graph object' do
subject.should_receive(:post).with('/api/v1/likes', :id => 1, :type => 'OpenGraphObject')
expect(subject).to receive(:post).with('/api/v1/likes', :id => 1, :type => 'OpenGraphObject')
subject.like('OpenGraphObject', 1)
end

it 'should unlike open graph object' do
subject.should_receive(:delete).with('/api/v1/likes/1')
expect(subject).to receive(:delete).with('/api/v1/likes/1')
subject.unlike(1)
end
end
Expand Down
32 changes: 16 additions & 16 deletions spec/api/message_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
context 'with options' do
it 'should get_messages' do
params = { :page => 1 }
subject.should_receive(:get).with('/api/v1/messages', params)
expect(subject).to receive(:get).with('/api/v1/messages', params)
subject.all_messages(params)
end
end

context 'without options' do
it 'should return all messages viewable by a user' do
subject.should_receive(:get).with('/api/v1/messages', {})
expect(subject).to receive(:get).with('/api/v1/messages', {})
subject.all_messages
end
end
Expand All @@ -52,98 +52,98 @@
describe '#create_message' do
it 'should create_message' do
message = 'Greetings, we come in peace'
subject.should_receive(:post).with('/api/v1/messages', :body => message)
expect(subject).to receive(:post).with('/api/v1/messages', :body => message)
subject.create_message(message)
end
end

describe '#message' do
it 'should fetch a message' do
subject.should_receive(:get).with('/api/v1/messages/3')
expect(subject).to receive(:get).with('/api/v1/messages/3')
subject.get_message(3)
end
end

describe '#delete_message' do
it 'should delete a message' do
subject.should_receive(:delete).with('/api/v1/messages/4')
expect(subject).to receive(:delete).with('/api/v1/messages/4')
subject.delete_message(4)
end
end

describe '#messages_sent' do
it 'should fetch messages sent by a user' do
subject.should_receive(:get).with('/api/v1/messages/sent', {})
expect(subject).to receive(:get).with('/api/v1/messages/sent', {})
subject.messages_sent
end
end

describe '#messages_received' do
it 'should fetch messages received by a user' do
subject.should_receive(:get).with('/api/v1/messages/received', {})
expect(subject).to receive(:get).with('/api/v1/messages/received', {})
subject.messages_received
end
end

describe '#private_messages' do
it 'should fetch private messages' do
subject.should_receive(:get).with('/api/v1/messages/private', {})
expect(subject).to receive(:get).with('/api/v1/messages/private', {})
subject.private_messages
end
end

describe '#followed_messages' do
it 'should fetch messages followed by a user' do
subject.should_receive(:get).with('/api/v1/messages/following', {})
expect(subject).to receive(:get).with('/api/v1/messages/following', {})
subject.followed_messages
end
end

describe '#messages_from_user' do
it 'should fetch messages created by a user' do
subject.should_receive(:get).with('/api/v1/messages/from_user/14', {})
expect(subject).to receive(:get).with('/api/v1/messages/from_user/14', {})
subject.messages_from_user(14)
end
end

describe '#messages_about_topic' do
it 'should fetch messages about a topic' do
subject.should_receive(:get).with('/api/v1/messages/about_topic/19', {})
expect(subject).to receive(:get).with('/api/v1/messages/about_topic/19', {})
subject.messages_about_topic(19)
end
end

describe '#messages_in_group' do
it 'should fetch messages in group' do
subject.should_receive(:get).with('/api/v1/messages/in_group/26', {})
expect(subject).to receive(:get).with('/api/v1/messages/in_group/26', {})
subject.messages_in_group(26)
end
end

describe '#messages_liked_by' do
it 'should fetch messages liked by user' do
subject.should_receive(:get).with('/api/v1/messages/liked_by/58', {})
expect(subject).to receive(:get).with('/api/v1/messages/liked_by/58', {})
subject.messages_liked_by(58)
end
end

describe '#like_message' do
it 'should like the message as a the specified user' do
subject.should_receive(:post).with('/api/v1/messages/liked_by/current.json?message_id=97', {})
expect(subject).to receive(:post).with('/api/v1/messages/liked_by/current.json?message_id=97', {})
subject.like_message(97)
end
end

describe '#unlike_message' do
it 'should unlike the message as a the specified user' do
subject.should_receive(:delete).with('/api/v1/messages/liked_by/current.json?message_id=97', {})
expect(subject).to receive(:delete).with('/api/v1/messages/liked_by/current.json?message_id=97', {})
subject.unlike_message(97)
end
end

describe '#messages_in_thread' do
it 'should fetch messages in thread' do
subject.should_receive(:get).with('/api/v1/messages/in_thread/97', {})
expect(subject).to receive(:get).with('/api/v1/messages/in_thread/97', {})
subject.messages_in_thread(97)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/api/network_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

describe '#networks_current' do
it 'should fetch network data' do
subject.should_receive(:get).with('/api/v1/networks/current', { :include_suspended => true })
expect(subject).to receive(:get).with('/api/v1/networks/current', { :include_suspended => true })
subject.current_networks({ :include_suspended => true })
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/api/notification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

describe '#notifications' do
it "should fetch authenticated user's notifications" do
subject.should_receive(:get).with('/api/v1/streams/notifications')
expect(subject).to receive(:get).with('/api/v1/streams/notifications')
subject.notifications
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/api/open_graph_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
:site_name => 'Microsoft',
:image => 'https://example.com/global/images/test.jpg'
}
subject.should_receive(:post).with('/api/v1/open_graph_objects', {
expect(subject).to receive(:post).with('/api/v1/open_graph_objects', {
:url=>"http://www.example.com",
:properties => {
:site_name => "Microsoft",
Expand All @@ -50,17 +50,17 @@
end

it 'should follow open graph object' do
subject.should_receive(:post).with('/api/v1/subscriptions', :target_id => 7, :target_type => 'OpenGraphObject')
expect(subject).to receive(:post).with('/api/v1/subscriptions', :target_id => 7, :target_type => 'OpenGraphObject')
subject.follow_open_graph_object(7)
end

it 'should follow opnen graph object' do
subject.should_receive(:get).with('/api/v1/subscriptions/to_open_graph_object/5')
expect(subject).to receive(:get).with('/api/v1/subscriptions/to_open_graph_object/5')
subject.is_following_open_graph_object?(5)
end

it 'should fetch open graph objects in user activity stream' do
subject.should_receive(:get).with('/api/v1/streams/activities', :owner_type => 'open_graph_object', :owner_id => 4)
expect(subject).to receive(:get).with('/api/v1/streams/activities', :owner_type => 'open_graph_object', :owner_id => 4)
subject.get_activity_stream_open_graph_objects(4)
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/api/pending_attachment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@

describe '#get_pending_attachment' do
it 'should fetch a pending attachment' do
subject.should_receive(:get).with('/api/v1/pending_attachments/2')
expect(subject).to receive(:get).with('/api/v1/pending_attachments/2')
subject.get_pending_attachment(2)
end
end

describe '#delete_pending_attachment' do
it 'should delete a pending attachment' do
subject.should_receive(:delete).with('/api/v1/pending_attachments/1')
expect(subject).to receive(:delete).with('/api/v1/pending_attachments/1')
subject.delete_pending_attachment(1)
end
end

describe '#create_pending_attachment' do
it 'should create a pending attachment' do
attachment = upload('attachment.txt')
subject.should_receive(:post).with('/api/v1/pending_attachments', :attachment => attachment)
expect(subject).to receive(:post).with('/api/v1/pending_attachments', :attachment => attachment)
subject.create_pending_attachment(attachment)
end
end
Expand Down
Loading

0 comments on commit aa33a82

Please sign in to comment.