Module: RSpec
- Defined in:
- lib/r_spec.rb,
lib/r_spec/dsl.rb,
lib/r_spec/error.rb,
lib/r_spec/console.rb,
lib/r_spec/expectation_helper.rb,
lib/r_spec/expectation_target.rb,
lib/r_spec/error/reserved_method.rb,
lib/r_spec/expectation_helper/it.rb,
lib/r_spec/expectation_helper/its.rb,
lib/r_spec/error/undefined_subject.rb,
lib/r_spec/expectation_target/base.rb,
lib/r_spec/expectation_target/block.rb,
lib/r_spec/expectation_target/value.rb,
lib/r_spec/error/pending_expectation.rb,
lib/r_spec/expectation_helper/shared.rb,
lib/r_spec/error/undefined_described_class.rb
Overview
Top level namespace for the RSpec clone.
Defined Under Namespace
Modules: Console, Error, ExpectationHelper, ExpectationTarget Classes: Dsl
Class Method Summary collapse
-
.context(description, &block) ⇒ Object
Defines an example group that establishes a specific context, like _empty array_ versus _array with elements_.
-
.describe(const, &block) ⇒ Object
Defines an example group that describes a unit to be tested.
-
.it(name = nil, &block) ⇒ nil
Defines a concrete test case.
-
.pending(message) ⇒ nil
Defines a pending test case.
Class Method Details
.context(description, &block) ⇒ Object
Defines an example group that establishes a specific context, like _empty array_ versus _array with elements_.
Unlike describe, the block is evaluated in isolation in order to scope possible side effects inside its context.
91 92 93 |
# File 'lib/r_spec.rb', line 91 def self.context(description, &block) Dsl.context(description, &block) end |
.describe(const, &block) ⇒ Object
Defines an example group that describes a unit to be tested.
113 114 115 |
# File 'lib/r_spec.rb', line 113 def self.describe(const, &block) Dsl.describe(const, &block) end |
.it(name = nil, &block) ⇒ nil
Defines a concrete test case.
The test is performed by the block supplied to &block.
It is usually used inside a RSpec::Dsl.describe or RSpec::Dsl.context section.
138 139 140 |
# File 'lib/r_spec.rb', line 138 def self.it(name = nil, &block) Dsl.it(name, &block) end |
.pending(message) ⇒ nil
Defines a pending test case.
‘&block` is never evaluated. It can be used to describe behaviour that is not yet implemented.
It is usually used inside a RSpec::Dsl.describe or RSpec::Dsl.context section.
167 168 169 |
# File 'lib/r_spec.rb', line 167 def self.pending() Dsl.pending() end |