diff --git a/src/spectator.cr b/src/spectator.cr index b11eef7..c00c080 100644 --- a/src/spectator.cr +++ b/src/spectator.cr @@ -47,6 +47,11 @@ module Spectator end end + # ditto + macro context(what, &block) + describe({{what}}) {{block}} + end + # Flag indicating whether Spectator should automatically run tests. # This should be left alone (set to true) in typical usage. # There are times when Spectator shouldn't run tests. diff --git a/src/spectator/dsl/structure_dsl.cr b/src/spectator/dsl/structure_dsl.cr index f4d77de..7522aaf 100644 --- a/src/spectator/dsl/structure_dsl.cr +++ b/src/spectator/dsl/structure_dsl.cr @@ -1272,7 +1272,7 @@ module Spectator::DSL # pre_condition { expect(array.size).to eq(3) } # 2 # ``` # - # With nested groups, the inner blocks will run first. + # With nested groups, the outer blocks will run first. # ``` # describe Something do # pre_condition { is_expected.to_not be_nil } # 1 @@ -1499,6 +1499,18 @@ module Spectator::DSL peding({{block.body.stringify}}) {{block}} end + # Same as `#pending`. + # Included for compatibility with RSpec. + macro skip(what, &block) + pending({{what}}) {{block}} + end + + # Same as `#pending`. + # Included for compatibility with RSpec. + macro skip(&block) + pending({{block.body.stringify}}) {{block}} + end + # Same as `#pending`. # Included for compatibility with RSpec. macro xit(what, &block) diff --git a/src/spectator/matchers/alternative_match_data_value.cr b/src/spectator/matchers/alternative_match_data_value.cr index 49e904a..e368c0f 100644 --- a/src/spectator/matchers/alternative_match_data_value.cr +++ b/src/spectator/matchers/alternative_match_data_value.cr @@ -21,7 +21,7 @@ module Spectator::Matchers # Produces a stringified value. def to_s(io) - io << value + @value.inspect(io) end # Produces a stringified value with additional information. diff --git a/src/spectator/matchers/generic_match_data_value.cr b/src/spectator/matchers/generic_match_data_value.cr index 3d751f9..9069489 100644 --- a/src/spectator/matchers/generic_match_data_value.cr +++ b/src/spectator/matchers/generic_match_data_value.cr @@ -12,7 +12,7 @@ module Spectator::Matchers # Stringifies the value. def to_s(io) - io << @value + @value.inspect(io) end # Inspects the value. diff --git a/src/spectator/matchers/negatable_match_data_value.cr b/src/spectator/matchers/negatable_match_data_value.cr index ac764fe..62abf49 100644 --- a/src/spectator/matchers/negatable_match_data_value.cr +++ b/src/spectator/matchers/negatable_match_data_value.cr @@ -21,7 +21,7 @@ module Spectator::Matchers # The string will be prefixed with "Not" when negated. def to_s(io) io << "Not " if @negated - io << @value + @value.inspect(io) end # Produces a stringified value with additional information. diff --git a/src/spectator/matchers/negatable_prefixed_match_data_value.cr b/src/spectator/matchers/negatable_prefixed_match_data_value.cr index f4cf4ea..9cc6138 100644 --- a/src/spectator/matchers/negatable_prefixed_match_data_value.cr +++ b/src/spectator/matchers/negatable_prefixed_match_data_value.cr @@ -26,7 +26,7 @@ module Spectator::Matchers def to_s(io) io << prefix io << ' ' - io << @value + @value.inspect(io) end # Produces a stringified value with additional information. diff --git a/src/spectator/matchers/prefixed_match_data_value.cr b/src/spectator/matchers/prefixed_match_data_value.cr index 1e22002..feea8cc 100644 --- a/src/spectator/matchers/prefixed_match_data_value.cr +++ b/src/spectator/matchers/prefixed_match_data_value.cr @@ -14,7 +14,7 @@ module Spectator::Matchers def to_s(io) io << @prefix io << ' ' - io << @value + @value.inspect(io) end # Outputs details of the formatted value with a prefix.