diff --git a/src/spectator/expectations/value_expectation.cr b/src/spectator/expectations/value_expectation.cr index be3b786..7e05d5e 100644 --- a/src/spectator/expectations/value_expectation.cr +++ b/src/spectator/expectations/value_expectation.cr @@ -2,8 +2,9 @@ require "./expectation" module Spectator::Expectations # Expectation that operates on values. - # There is a primary "actual" value that the SUT produced. - # A matcher is used on that value to determine whether it satisfies some criteria. + # There are two values - the actual and expected. + # The actual value is what the SUT returned. + # The expected value is what the test wants to see. class ValueExpectation(ActualType) < Expectation # Creates the expectation. # The `matched` flag should be true if the matcher is satisfied with the partial. diff --git a/test.cr b/test.cr new file mode 100644 index 0000000..80a9a19 --- /dev/null +++ b/test.cr @@ -0,0 +1,8 @@ +require "./src/spectator" + +Spectator.describe String do + let(x) { 7 } + it "a" { expect(x).to(eq(nil)) } + it "b" { expect(x.odd?).to(be_true) } + it "c" { expect(x).to(eq(42)) } +end