Class: ConvenientService::RSpec::Helpers::Classes::StubService::Entities::StubbedService
- Inherits:
-
Object
- Object
- ConvenientService::RSpec::Helpers::Classes::StubService::Entities::StubbedService
- Includes:
- Support::DependencyContainer::Import
- Defined in:
- lib/convenient_service/rspec/helpers/classes/stub_service/entities/stubbed_service.rb
Instance Method Summary collapse
- #initialize(service_class:) ⇒ void constructor
- #to(result_spec) ⇒ ConvenientService::RSpec::Helpers::Classes::StubService::Entities::StubService
- #with_arguments ⇒ ConvenientService::RSpec::Helpers::Classes::StubService::Entities::StubService
- #without_arguments ⇒ ConvenientService::RSpec::Helpers::Classes::StubService::Entities::StubService
Methods included from Support::Concern
Constructor Details
#initialize(service_class:) ⇒ void
28 29 30 31 |
# File 'lib/convenient_service/rspec/helpers/classes/stub_service/entities/stubbed_service.rb', line 28 def initialize(service_class:) @service_class = service_class @arguments = Support::Arguments.null_arguments end |
Instance Method Details
#to(result_spec) ⇒ ConvenientService::RSpec::Helpers::Classes::StubService::Entities::StubService
55 56 57 58 59 60 61 62 63 |
# File 'lib/convenient_service/rspec/helpers/classes/stub_service/entities/stubbed_service.rb', line 55 def to(result_spec) @result_spec = result_spec service_class.commit_config!(trigger: Constants::Triggers::STUB_SERVICE) commands.SetServiceStubbedResult[service: service_class, arguments: arguments, result: result_value] self end |
#with_arguments ⇒ ConvenientService::RSpec::Helpers::Classes::StubService::Entities::StubService
36 37 38 39 40 |
# File 'lib/convenient_service/rspec/helpers/classes/stub_service/entities/stubbed_service.rb', line 36 def with_arguments(...) @arguments = Support::Arguments.new(...) self end |
#without_arguments ⇒ ConvenientService::RSpec::Helpers::Classes::StubService::Entities::StubService
45 46 47 48 49 |
# File 'lib/convenient_service/rspec/helpers/classes/stub_service/entities/stubbed_service.rb', line 45 def without_arguments @arguments = Support::Arguments.null_arguments self end |