Skip to content

Commit

Permalink
Merge pull request #1 from asaaki/pending
Browse files Browse the repository at this point in the history
added the 'pending rocket' from asaaki
  • Loading branch information
Peter Cooper committed Aug 12, 2011
2 parents 4079e4d + 7fee16e commit f89303e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions lib/testrocket.rb
Expand Up @@ -7,9 +7,11 @@ def _test(a, b)

def +@; r = _test :_pass, :_fail; (TestRocket.out || $>).puts r; r end
def -@; r = _test :_fail, :_pass; (TestRocket.out || $>).puts r; r end

def ~@; r = _pend; (TestRocket.out || $>).puts r; r end

def _pass; ' OK'; end
def _fail; "FAIL @ #{source_location.join(':')}"; end
def _pend; "PENDING '#{call.to_s}' @ #{source_location.join(':')}"; end
end

Proc.send :include, TestRocket
Proc.send :include, TestRocket
6 changes: 5 additions & 1 deletion test/test_testrocket.rb
Expand Up @@ -20,4 +20,8 @@
it "should fail a simple correct assertion assumed to fail" do
(-->{ 2 + 2 == 4 }).must_match(/FAIL/)
end
end

it "should give a pending notice" do
(~->{ "a pending test" }).must_match(/PENDING/)
end
end
4 changes: 2 additions & 2 deletions testrocket.gemspec
Expand Up @@ -6,8 +6,8 @@ Gem::Specification.new do |s|
s.name = "testrocket"
s.version = Testrocket::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Peter Cooper"]
s.email = ["git@peterc.org"]
s.authors = ["Peter Cooper","Christoph Grabo"]
s.email = ["git@peterc.org","chris@dinarrr.com"]
s.homepage = "http://github.com/peterc/testrocket"
s.summary = %q{A super lightweight testing library for Ruby}
s.description = %q{A super lightweight testing library for Ruby}
Expand Down

0 comments on commit f89303e

Please sign in to comment.