lib/fix/context.rb in fix-1.0.0.beta3 vs lib/fix/context.rb in fix-1.0.0.beta4

- old
+ new

@@ -107,9 +107,22 @@ ensure @after_hooks.each { |hook| i.instance_eval(&hook) } raise ExpectationResultNotFoundError, result.class.inspect unless result.is_a?(::Spectus::Result::Common) end + def its(name, *args, **options, &block) + if callable.raised? + actual = callable + challenge = ::Defi.send(:call) + else + actual = callable.object + challenge = ::Defi.send(name, *args, **options) + end + + o = Context.new(actual, challenge, @before_hooks.length, *@before_hooks + @after_hooks, **@lets) + o.it(&block) + end + def on(name, *args, **options, &block) if callable.raised? actual = callable challenge = ::Defi.send(:call) else