mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Use run_successfully matcher in service specs
This commit is contained in:
committed by
Loïc Guitaut
parent
0977f9fb47
commit
d26d45540e
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user