Skip to content

Commit

Permalink
Add Client class test
Browse files Browse the repository at this point in the history
  • Loading branch information
whyayen committed Jan 12, 2022
1 parent e6d802a commit c1682bc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/ezpay-invoice/client_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
RSpec.describe EzpayInvoice::Client do
describe "#initialize" do
context "configuration" do
it "reads global configuration by default" do
EzpayInvoice.setup { |config| config.merchant_id = 'fake_merchant_id' }
client = EzpayInvoice::Client.new

expect(client.merchant_id).to eq('fake_merchant_id')
end

it "reads instance configuration if options were set" do
EzpayInvoice.setup { |config| config.merchant_id = 'global_merchant_id' }
client = EzpayInvoice::Client.new({merchant_id: 'instance_merchant_id'})

expect(client.merchant_id).to eq('instance_merchant_id')
end
end
end
end

0 comments on commit c1682bc

Please sign in to comment.