diff --git a/lib/xeroizer/oauth.rb b/lib/xeroizer/oauth.rb index fe31a72f..e9b960a5 100644 --- a/lib/xeroizer/oauth.rb +++ b/lib/xeroizer/oauth.rb @@ -37,7 +37,7 @@ def initialize(description, retry_after: nil, daily_limit_remaining: nil) super(description) @retry_after = retry_after - @daily_limit_remaining = @daily_limit_remaining + @daily_limit_remaining = daily_limit_remaining end attr_reader :retry_after, :daily_limit_remaining diff --git a/test/unit/http_test.rb b/test/unit/http_test.rb index 696b0b43..98075d96 100644 --- a/test/unit/http_test.rb +++ b/test/unit/http_test.rb @@ -180,6 +180,8 @@ class HttpTest < UnitTestCase assert_match /rate limit exceeded/i, error.message assert_match /328 requests left for the day/i, error.message assert_match /42 seconds until you can make another request/i, error.message + assert_equal 42, error.retry_after + assert_equal 328, error.daily_limit_remaining end end end