Skip to content

Commit

Permalink
Fix attr assignment in OAuth::RateLimitExceeded (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
nnc authored Sep 29, 2021
1 parent 1b805ef commit f2ce432
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/xeroizer/oauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/unit/http_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f2ce432

Please sign in to comment.