Skip to content

Commit

Permalink
Use class instance vars
Browse files Browse the repository at this point in the history
  • Loading branch information
jm-mailosaur committed Aug 1, 2024
1 parent 36b791d commit 7907569
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/errors_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
module Mailosaur
class ErrorsTest < Test::Unit::TestCase
setup do
@@api_key = ENV['MAILOSAUR_API_KEY']
@@base_url = ENV['MAILOSAUR_BASE_URL']
@api_key = ENV['MAILOSAUR_API_KEY']
@base_url = ENV['MAILOSAUR_BASE_URL']

raise ArgumentError, 'Missing necessary environment variables - refer to README.md' if @@api_key.nil?
end

should 'Unauthorized' do
client = MailosaurClient.new('invalid_key', @@base_url)
client = MailosaurClient.new('invalid_key', @base_url)
ex = assert_raise(Mailosaur::MailosaurError) do
client.servers.list
pass
Expand All @@ -21,7 +21,7 @@ class ErrorsTest < Test::Unit::TestCase
end

should 'Not Found' do
client = MailosaurClient.new(@@api_key, @@base_url)
client = MailosaurClient.new(@api_key, @base_url)
ex = assert_raise(Mailosaur::MailosaurError) do
client.servers.get('not_found')
pass
Expand All @@ -30,7 +30,7 @@ class ErrorsTest < Test::Unit::TestCase
end

should 'Bad Request' do
client = MailosaurClient.new(@@api_key, @@base_url)
client = MailosaurClient.new(@api_key, @base_url)
ex = assert_raise(Mailosaur::MailosaurError) do
create_options = Mailosaur::Models::ServerCreateOptions.new
client.servers.create(create_options)
Expand Down

0 comments on commit 7907569

Please sign in to comment.