lib/r_spec.rb in r_spec-clone-1.1.0 vs lib/r_spec.rb in r_spec-clone-1.2.0
- old
+ new
@@ -87,10 +87,20 @@
# @api public
def self.context(description, &block)
Clone::Dsl.context(description, &block)
end
+ # :nocov:
+ #
+ # Runs a context example group in a subprocess to isolate side effects.
+ #
+ # @param (see #context)
+ def self.context!(description, &block)
+ Clone::Dsl.context!(description, &block)
+ end
+ # :nocov:
+
# Defines an example group that describes a unit to be tested.
#
# @example
# require "r_spec/clone"
#
@@ -109,10 +119,20 @@
# @api public
def self.describe(const, &block)
Clone::Dsl.describe(const, &block)
end
+ # :nocov:
+ #
+ # Runs a describe example group in a subprocess to isolate side effects.
+ #
+ # @param (see #describe)
+ def self.describe!(const, &block)
+ Clone::Dsl.describe!(const, &block)
+ end
+ # :nocov:
+
# Defines a concrete test case.
#
# The test is performed by the block supplied to &block.
#
# @example The integer after 41
@@ -134,9 +154,35 @@
#
# @api public
def self.it(name = nil, &block)
Clone::Dsl.it(name, &block)
end
+
+ # :nocov:
+ #
+ # Runs a concrete test case in a subprocess to isolate side effects.
+ #
+ # @example
+ # app = "Hello, world!"
+ #
+ # RSpec.it! { expect(app.gsub!("world", "Alice")).to eq "Hello, Alice!" }
+ #
+ # # Output to the console
+ # # Success: expected to eq "Hello, Alice!".
+ #
+ # RSpec.it { expect(app).to eq "Hello, world!" }
+ #
+ # # Output to the console
+ # # Success: expected to eq "Hello, world!".
+ #
+ # @param (see #it)
+ #
+ # @raise (see ExpectationTarget::Base#result)
+ # @return (see ExpectationTarget::Base#result)
+ def self.it!(name = nil, &block)
+ Clone::Dsl.it!(name, &block)
+ end
+ # :nocov:
# Defines a pending test case.
#
# `&block` is never evaluated. It can be used to describe behaviour that is
# not yet implemented.