From b2caa148ff57145356e31256faacf05ecee136a6 Mon Sep 17 00:00:00 2001 From: Aaron Rosenberg Date: Sat, 9 Oct 2021 18:51:29 -0500 Subject: [PATCH 1/2] Fix URL in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cf90766..6227797 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ The [API Test Client](https://developer.okta.com/docs/api/getting_started/api_te ## Contributing -1. Fork it ( ) +1. Fork it ( ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) From 1cb45eab479e826698de41848ff077abfacbe6bd Mon Sep 17 00:00:00 2001 From: Aaron Rosenberg Date: Sat, 9 Oct 2021 18:54:14 -0500 Subject: [PATCH 2/2] Update Oktakit.new convenience method for Ruby 3 Add spec to ensure it is working Hash and keyword coercion was deprecated in Ruby 3 w/ warnings in Ruby 2.7. See https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ for additional information or my post detailing it in https://medium.com/building-rigup/hash-and-keyword-coercion-213425f69719 --- lib/oktakit.rb | 4 ++-- spec/oktakit_spec.rb | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/oktakit.rb b/lib/oktakit.rb index 24f2865..2575f1d 100644 --- a/lib/oktakit.rb +++ b/lib/oktakit.rb @@ -2,7 +2,7 @@ require 'oktakit/client' module Oktakit - def self.new(*args) - Client.new(*args) + def self.new(**args) + Client.new(**args) end end diff --git a/spec/oktakit_spec.rb b/spec/oktakit_spec.rb index 273f06f..333c7a2 100644 --- a/spec/oktakit_spec.rb +++ b/spec/oktakit_spec.rb @@ -5,6 +5,13 @@ expect(Oktakit::VERSION).not_to(be(nil)) end + describe '.new' do + it 'creates a client with the passed in keyword arguments' do + client = Oktakit.new(token: test_okta_token, organization: 'okta-test') + expect(client.api_endpoint).to(eq('https://okta-test.okta.com/api/v1')) + end + end + describe 'client' do it 'has a default API endpoint' do client = Oktakit::Client.new(token: test_okta_token, organization: 'okta-test')