Skip to content

Commit

Permalink
Fix line and number on natural assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
blowmage committed Jan 19, 2013
1 parent f67a061 commit 0c731d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/minitest/given.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def self.Given *args, &block
def self.Then &block
# I want to call wrong's assert passing the block!
# I don't want to call the standard assert here.
it { assert instance_eval(&block) }
file, line = eval("[__FILE__, __LINE__]", block.binding)
it { instance_eval("assert(false)", file, line) unless instance_eval(&block) }
end

class << self
Expand Down

0 comments on commit 0c731d0

Please sign in to comment.