lib/assert/context/test_dsl.rb in assert-2.16.3 vs lib/assert/context/test_dsl.rb in assert-2.16.4
- old
+ new
@@ -13,42 +13,42 @@
instance_eval(&desc_or_macro)
elsif block_given?
# create a test from the given code block
self.suite.on_test(Assert::Test.for_block(
desc_or_macro.kind_of?(Assert::Macro) ? desc_or_macro.name : desc_or_macro,
- Assert::ContextInfo.new(self, called_from, first_caller || caller.first),
+ Assert::ContextInfo.new(self, called_from, first_caller || caller_locations.first),
self.suite.config,
&block
))
else
- test_eventually(desc_or_macro, called_from, first_caller || caller.first, &block)
+ test_eventually(desc_or_macro, called_from, first_caller || caller_locations.first, &block)
end
end
def test_eventually(desc_or_macro, called_from = nil, first_caller = nil, &block)
# create a test from a proc that just skips
- ci = Assert::ContextInfo.new(self, called_from, first_caller || caller.first)
+ ci = Assert::ContextInfo.new(self, called_from, first_caller || caller_locations.first)
self.suite.on_test(Assert::Test.for_block(
desc_or_macro.kind_of?(Assert::Macro) ? desc_or_macro.name : desc_or_macro,
ci,
self.suite.config,
- &proc { skip('TODO', ci.called_from) }
+ &proc { skip('TODO', [ci.called_from.to_s]) }
))
end
alias_method :test_skip, :test_eventually
def should(desc_or_macro, called_from = nil, first_caller = nil, &block)
if !desc_or_macro.kind_of?(Assert::Macro)
desc_or_macro = "should #{desc_or_macro}"
end
- test(desc_or_macro, called_from, first_caller || caller.first, &block)
+ test(desc_or_macro, called_from, first_caller || caller_locations.first, &block)
end
def should_eventually(desc_or_macro, called_from = nil, first_caller = nil, &block)
if !desc_or_macro.kind_of?(Assert::Macro)
desc_or_macro = "should #{desc_or_macro}"
end
- test_eventually(desc_or_macro, called_from, first_caller || caller.first, &block)
+ test_eventually(desc_or_macro, called_from, first_caller || caller_locations.first, &block)
end
alias_method :should_skip, :should_eventually
end