DEV: Use run_successfully matcher in service specs

This commit is contained in:
Loïc Guitaut
2024-08-28 14:54:10 +02:00
committed by Loïc Guitaut
parent 0977f9fb47
commit d26d45540e
40 changed files with 189 additions and 181 deletions

View File

@@ -10,8 +10,24 @@ module ServiceMatchers
end
def failure_message
message = "Expected the service to succeed but it failed."
error_message_with_inspection(message)
end
def failure_message_when_negated
message = "Expected the service to fail but it succeeded."
error_message_with_inspection(message)
end
def description
"run the service successfully"
end
private
def error_message_with_inspection(message)
inspector = StepsInspector.new(result)
"Expected to run the service sucessfully but failed:\n\n#{inspector.inspect}\n\n#{inspector.error}"
"#{message}\n\n#{inspector.inspect}\n\n#{inspector.error}"
end
end
@@ -137,7 +153,7 @@ module ServiceMatchers
FailStep.new(name)
end
def run_service_successfully
def run_successfully
RunServiceSuccessfully.new
end