module Spec::Methods
Defined in:
spec/methods.crInstance Method Summary
-
#assert(file = __FILE__, line = __LINE__, end_line = __END_LINE__, &block)
DEPRECATED Use
#it
-
#context(description, file = __FILE__, line = __LINE__, &block)
Defines an example group that establishes a specific context, like empty array versus array with elements.
-
#describe(description, file = __FILE__, line = __LINE__, &block)
Defines an example group that describes a unit to be tested.
-
#fail(msg, file = __FILE__, line = __LINE__)
Fails an example.
-
#it(description = "assert", file = __FILE__, line = __LINE__, end_line = __END_LINE__, &block)
Defines a concrete test case.
-
#pending(description = "assert", file = __FILE__, line = __LINE__, end_line = __END_LINE__, &block)
Defines a pending test case.
-
#pending(description = "assert", file = __FILE__, line = __LINE__, end_line = __END_LINE__)
Defines a yet-to-be-implemented pending test case
Instance Method Detail
Defines an example group that establishes a specific context,
like empty array versus array with elements.
Inside &block examples are defined by #it
or #pending
.
It is functionally equivalent to #describe
.
Defines an example group that describes a unit to be tested.
Inside &block examples are defined by #it
or #pending
.
Several #describe
blocks can be nested.
Example:
describe "Int32" do
describe "+" do
it "adds" { (1 + 1).should eq 2 }
end
end
Fails an example.
This method can be used to manually fail an example defined in an #it
block.
Defines a concrete test case.
The test is performed by the block supplied to &block.
Example:
it "adds" { (1 + 1).should eq 2 }
Defines a pending test case.
&block is never evaluated. It can be used to describe behaviour that is not yet implemented.
Example:
pending "check cat" { cat.alive? }
Defines a yet-to-be-implemented pending test case