Class: ConvenientService::RSpec::Matchers::Classes::Export
- Inherits:
-
Object
- Object
- ConvenientService::RSpec::Matchers::Classes::Export
- 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: Support::DependencyContainer::Constants::DEFAULT_SCOPE) ⇒ void constructor
- #matches?(container) ⇒ Boolean
Constructor Details
#initialize(slug, scope: Support::DependencyContainer::Constants::DEFAULT_SCOPE) ⇒ void
18 19 20 21 |
# File 'lib/convenient_service/rspec/matchers/classes/export.rb', line 18 def initialize(slug, scope: Support::DependencyContainer::Constants::DEFAULT_SCOPE) @slug = slug @scope = scope end |
Instance Method Details
#description ⇒ String
39 40 41 |
# File 'lib/convenient_service/rspec/matchers/classes/export.rb', line 39 def description "export `#{slug}` with scope `#{scope}`" end |
#failure_message ⇒ String
46 47 48 |
# File 'lib/convenient_service/rspec/matchers/classes/export.rb', line 46 def "expected `#{container}` to export `#{slug}` with scope `#{scope}`" end |
#failure_message_when_negated ⇒ String
53 54 55 |
# File 'lib/convenient_service/rspec/matchers/classes/export.rb', line 53 def "expected `#{container}` NOT to export `#{slug}` with scope `#{scope}`" end |
#matches?(container) ⇒ Boolean
27 28 29 30 31 32 33 34 |
# File 'lib/convenient_service/rspec/matchers/classes/export.rb', line 27 def matches?(container) @container = container Support::DependencyContainer::Commands::AssertValidContainer[container: container] Support::DependencyContainer::Commands::AssertValidScope[scope: scope] Utils.to_bool(container.exported_methods.find_by(slug: slug, scope: scope)) end |