diff options
Diffstat (limited to 'spec/lib/mattermost')
-rw-r--r-- | spec/lib/mattermost/client_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/mattermost/command_spec.rb | 6 | ||||
-rw-r--r-- | spec/lib/mattermost/session_spec.rb | 8 | ||||
-rw-r--r-- | spec/lib/mattermost/team_spec.rb | 8 |
4 files changed, 13 insertions, 13 deletions
diff --git a/spec/lib/mattermost/client_spec.rb b/spec/lib/mattermost/client_spec.rb index 32755d1103c..5d57a226baf 100644 --- a/spec/lib/mattermost/client_spec.rb +++ b/spec/lib/mattermost/client_spec.rb @@ -14,13 +14,13 @@ RSpec.describe Mattermost::Client do it 'yields an error on malformed JSON' do bad_json = Struct::Request.new("I'm not json", true) - expect { subject.send(:json_response, bad_json) }.to raise_error(Mattermost::ClientError) + expect { subject.send(:json_response, bad_json) }.to raise_error(::Mattermost::ClientError) end it 'shows a client error if the request was unsuccessful' do bad_request = Struct::Request.new("true", false) - expect { subject.send(:json_response, bad_request) }.to raise_error(Mattermost::ClientError) + expect { subject.send(:json_response, bad_request) }.to raise_error(::Mattermost::ClientError) end end end diff --git a/spec/lib/mattermost/command_spec.rb b/spec/lib/mattermost/command_spec.rb index 0f2711e0b11..18cd1ff97a6 100644 --- a/spec/lib/mattermost/command_spec.rb +++ b/spec/lib/mattermost/command_spec.rb @@ -6,10 +6,10 @@ RSpec.describe Mattermost::Command do let(:params) { { 'token' => 'token', team_id: 'abc' } } before do - session = Mattermost::Session.new(nil) + session = ::Mattermost::Session.new(nil) session.base_uri = 'http://mattermost.example.com' - allow_any_instance_of(Mattermost::Client).to receive(:with_session) + allow_any_instance_of(::Mattermost::Client).to receive(:with_session) .and_yield(session) end @@ -57,7 +57,7 @@ RSpec.describe Mattermost::Command do end it 'raises an error with message' do - expect { subject }.to raise_error(Mattermost::Error, 'This trigger word is already in use. Please choose another word.') + expect { subject }.to raise_error(::Mattermost::Error, 'This trigger word is already in use. Please choose another word.') end end end diff --git a/spec/lib/mattermost/session_spec.rb b/spec/lib/mattermost/session_spec.rb index 67ccb48e3a7..e2e1b4c28c7 100644 --- a/spec/lib/mattermost/session_spec.rb +++ b/spec/lib/mattermost/session_spec.rb @@ -33,7 +33,7 @@ RSpec.describe Mattermost::Session, type: :request do context 'without oauth uri' do it 'makes a request to the oauth uri' do - expect { subject.with_session }.to raise_error(Mattermost::NoSessionError) + expect { subject.with_session }.to raise_error(::Mattermost::NoSessionError) end end @@ -49,7 +49,7 @@ RSpec.describe Mattermost::Session, type: :request do it 'can not create a session' do expect do subject.with_session - end.to raise_error(Mattermost::NoSessionError) + end.to raise_error(::Mattermost::NoSessionError) end end @@ -113,13 +113,13 @@ RSpec.describe Mattermost::Session, type: :request do expect_to_cancel_exclusive_lease(lease_key, 'uuid') # Cannot set up a session, but we should still cancel the lease - expect { subject.with_session }.to raise_error(Mattermost::NoSessionError) + expect { subject.with_session }.to raise_error(::Mattermost::NoSessionError) end it 'returns a NoSessionError error without lease' do stub_exclusive_lease_taken(lease_key) - expect { subject.with_session }.to raise_error(Mattermost::NoSessionError) + expect { subject.with_session }.to raise_error(::Mattermost::NoSessionError) end end end diff --git a/spec/lib/mattermost/team_spec.rb b/spec/lib/mattermost/team_spec.rb index e3ef5ff5377..b2db770c9b9 100644 --- a/spec/lib/mattermost/team_spec.rb +++ b/spec/lib/mattermost/team_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Mattermost::Team do session = Mattermost::Session.new(nil) session.base_uri = 'http://mattermost.example.com' - allow_any_instance_of(Mattermost::Client).to receive(:with_session) + allow_any_instance_of(::Mattermost::Client).to receive(:with_session) .and_yield(session) end @@ -65,7 +65,7 @@ RSpec.describe Mattermost::Team do end it 'raises an error with message' do - expect { subject }.to raise_error(Mattermost::Error, 'Cannot list teams.') + expect { subject }.to raise_error(::Mattermost::Error, 'Cannot list teams.') end end end @@ -123,7 +123,7 @@ RSpec.describe Mattermost::Team do end it 'raises an error with message' do - expect { subject }.to raise_error(Mattermost::Error, 'A team with that name already exists') + expect { subject }.to raise_error(::Mattermost::Error, 'A team with that name already exists') end end end @@ -169,7 +169,7 @@ RSpec.describe Mattermost::Team do end it 'raises an error with message' do - expect { subject }.to raise_error(Mattermost::Error, "We couldn't find the existing team") + expect { subject }.to raise_error(::Mattermost::Error, "We couldn't find the existing team") end end end |