Class: ConvenientService::RSpec::Matchers::Classes::Export
- Inherits:
-
Object
- Object
- ConvenientService::RSpec::Matchers::Classes::Export
- Includes:
- Support::DependencyContainer::Import
- Defined in:
- lib/convenient_service/rspec/matchers/classes/export.rb
Instance Method Summary collapse
- #description ⇒ String
- #failure_message ⇒ String
- #failure_message_when_negated ⇒ String
- #initialize(slug, scope: constants.DEFAULT_SCOPE) ⇒ void constructor
- #matches?(container) ⇒ Boolean
Methods included from Support::DependencyContainer::Import
Constructor Details
#initialize(slug, scope: constants.DEFAULT_SCOPE) ⇒ void
19 20 21 22 |
# File 'lib/convenient_service/rspec/matchers/classes/export.rb', line 19 def initialize(slug, scope: constants.DEFAULT_SCOPE) @slug = slug @scope = scope end |
Instance Method Details
#description ⇒ String
41 42 43 |
# File 'lib/convenient_service/rspec/matchers/classes/export.rb', line 41 def description "export `#{slug}` with scope `#{scope}`" end |
#failure_message ⇒ String
48 49 50 |
# File 'lib/convenient_service/rspec/matchers/classes/export.rb', line 48 def "expected `#{container}` to export `#{slug}` with scope `#{scope}`" end |
#failure_message_when_negated ⇒ String
55 56 57 |
# File 'lib/convenient_service/rspec/matchers/classes/export.rb', line 55 def "expected `#{container}` NOT to export `#{slug}` with scope `#{scope}`" end |
#matches?(container) ⇒ Boolean
28 29 30 31 32 33 34 35 36 |
# File 'lib/convenient_service/rspec/matchers/classes/export.rb', line 28 def matches?(container) @container = container commands.AssertValidContainer.call(container: container) commands.AssertValidScope.call(scope: scope) Utils.to_bool(container.exported_methods.find_by(slug: slug, scope: scope)) end |