Module: ConvenientService::RSpec::Helpers::StubService

Defined in:
lib/convenient_service/rspec/helpers/stub_service.rb

Instance Method Summary collapse

Instance Method Details

#return_errorObject



23
24
25
# File 'lib/convenient_service/rspec/helpers/stub_service.rb', line 23

def return_error
  Classes::StubService::Entities::ResultSpec.new(status: :error)
end

#return_failureObject



19
20
21
# File 'lib/convenient_service/rspec/helpers/stub_service.rb', line 19

def return_failure
  Classes::StubService::Entities::ResultSpec.new(status: :failure)
end

#return_result(status) ⇒ Object



11
12
13
# File 'lib/convenient_service/rspec/helpers/stub_service.rb', line 11

def return_result(status)
  Classes::StubService::Entities::ResultSpec.new(status: status)
end

#return_successObject



15
16
17
# File 'lib/convenient_service/rspec/helpers/stub_service.rb', line 15

def return_success
  Classes::StubService::Entities::ResultSpec.new(status: :success)
end

#stub_serviceObject



7
8
9
# File 'lib/convenient_service/rspec/helpers/stub_service.rb', line 7

def stub_service(...)
  Classes::StubService.call(...)
end