Module: PadlockAuth::Matchers
- Defined in:
- lib/padlock_auth/rspec_support.rb
Overview
This module provides matchers for testing PadlockAuth access_token and strategy classes.
In your implementations, use these shared examples to ensure that your classes are compliant with the PadlockAuth API.
Instance Method Summary collapse
-
#be_a_padlock_auth_access_token ⇒ RSpec::Matchers::BuiltIn::BaseMatcher
Asserts that the subject matches the expected interface for a PadlockAuth access token.
-
#be_a_padlock_auth_strategy ⇒ RSpec::Matchers::BuiltIn::BaseMatcher
Asserts that the subject matches the expected interface for a PadlockAuth strategy.
Instance Method Details
#be_a_padlock_auth_access_token ⇒ RSpec::Matchers::BuiltIn::BaseMatcher
Asserts that the subject matches the expected interface for a PadlockAuth access token.
25 26 27 28 29 30 31 |
# File 'lib/padlock_auth/rspec_support.rb', line 25 def be_a_padlock_auth_access_token respond_to(:acceptable?).with(1).arguments .and(respond_to(:accessible?).with(0).arguments) .and(respond_to(:includes_scope?).with(1).arguments) .and(respond_to(:invalid_token_reason).with(0).arguments) .and(respond_to(:forbidden_token_reason).with(0).arguments) end |
#be_a_padlock_auth_strategy ⇒ RSpec::Matchers::BuiltIn::BaseMatcher
Asserts that the subject matches the expected interface for a PadlockAuth strategy.
37 38 39 40 41 |
# File 'lib/padlock_auth/rspec_support.rb', line 37 def be_a_padlock_auth_strategy respond_to(:build_access_token).with(1).arguments .and(respond_to(:build_invalid_token_response).with(1).arguments) .and(respond_to(:build_forbidden_token_response).with(2).arguments) end |