Skip to content

Commit

Permalink
Fixes #171
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Bergum Bergersen committed Sep 9, 2024
1 parent 31454bd commit 0285cbd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Alba.Testing/Assertions/BodyTextAssertionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void sad_path()
{
var assertion = new BodyTextAssertion("Hey!");
AssertionRunner.Run(assertion, env => env.Response.Write("Hey! You!"))
.Messages.Single().ShouldContain("Expected the content to be 'Hey!'");
.Messages.Single().ShouldBe("Expected the content to be 'Hey!', but was 'Hey! You!'");
}
}
}
4 changes: 1 addition & 3 deletions src/Alba/Assertions/BodyTextAssertion.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Microsoft.AspNetCore.Http;

namespace Alba.Assertions;

internal sealed class BodyTextAssertion : IScenarioAssertion
Expand All @@ -16,7 +14,7 @@ public void Assert(Scenario scenario, AssertionContext context)
var body = context.ReadBodyAsString();
if (!body.Equals(Text))
{
context.AddFailure($"Expected the content to be '{Text}'");
context.AddFailure($"Expected the content to be '{Text}', but was '{body}'");
}
}
}

0 comments on commit 0285cbd

Please sign in to comment.