Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow should to be called from the context.
This returns an instance of Peck::Should::Specification. In itself this doesn't do anything, but it allows you to add methods to Peck::Should::Specification so you can make stuff happen. The most obvious thing is to create a specification like displayed in the example (006).
- Loading branch information
Showing
3 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'preamble' | ||
|
||
class Peck | ||
class Should | ||
class Specification | ||
def handle_the_truth | ||
context.it('handles the truth') do | ||
true.should == true | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
describe "The test framework" do | ||
should.handle_the_truth | ||
end | ||
|
||
Peck.run | ||
|
||
require 'assert' | ||
|
||
assert(Peck.counter.ran == 1, | ||
"Expected 1 specification to have been run") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters