Merge branch 'master' of gitlab.com:arctic-fox/spectator

This commit is contained in:
Michael Miller 2019-04-05 23:53:55 -06:00
commit 12c71a25cd
7 changed files with 23 additions and 6 deletions

View file

@ -47,6 +47,11 @@ module Spectator
end end
end end
# ditto
macro context(what, &block)
describe({{what}}) {{block}}
end
# Flag indicating whether Spectator should automatically run tests. # Flag indicating whether Spectator should automatically run tests.
# This should be left alone (set to true) in typical usage. # This should be left alone (set to true) in typical usage.
# There are times when Spectator shouldn't run tests. # There are times when Spectator shouldn't run tests.

View file

@ -1272,7 +1272,7 @@ module Spectator::DSL
# pre_condition { expect(array.size).to eq(3) } # 2 # 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 # describe Something do
# pre_condition { is_expected.to_not be_nil } # 1 # pre_condition { is_expected.to_not be_nil } # 1
@ -1499,6 +1499,18 @@ module Spectator::DSL
peding({{block.body.stringify}}) {{block}} peding({{block.body.stringify}}) {{block}}
end 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`. # Same as `#pending`.
# Included for compatibility with RSpec. # Included for compatibility with RSpec.
macro xit(what, &block) macro xit(what, &block)

View file

@ -21,7 +21,7 @@ module Spectator::Matchers
# Produces a stringified value. # Produces a stringified value.
def to_s(io) def to_s(io)
io << value @value.inspect(io)
end end
# Produces a stringified value with additional information. # Produces a stringified value with additional information.

View file

@ -12,7 +12,7 @@ module Spectator::Matchers
# Stringifies the value. # Stringifies the value.
def to_s(io) def to_s(io)
io << @value @value.inspect(io)
end end
# Inspects the value. # Inspects the value.

View file

@ -21,7 +21,7 @@ module Spectator::Matchers
# The string will be prefixed with "Not" when negated. # The string will be prefixed with "Not" when negated.
def to_s(io) def to_s(io)
io << "Not " if @negated io << "Not " if @negated
io << @value @value.inspect(io)
end end
# Produces a stringified value with additional information. # Produces a stringified value with additional information.

View file

@ -26,7 +26,7 @@ module Spectator::Matchers
def to_s(io) def to_s(io)
io << prefix io << prefix
io << ' ' io << ' '
io << @value @value.inspect(io)
end end
# Produces a stringified value with additional information. # Produces a stringified value with additional information.

View file

@ -14,7 +14,7 @@ module Spectator::Matchers
def to_s(io) def to_s(io)
io << @prefix io << @prefix
io << ' ' io << ' '
io << @value @value.inspect(io)
end end
# Outputs details of the formatted value with a prefix. # Outputs details of the formatted value with a prefix.