diff --git a/lib/hirb/view.rb b/lib/hirb/view.rb index 75e60d7..30d8849 100644 --- a/lib/hirb/view.rb +++ b/lib/hirb/view.rb @@ -183,7 +183,7 @@ def enable_output_method @output_method = true ::IRB::Irb.class_eval do alias_method :non_hirb_view_output, :output_value - def output_value #:nodoc: + def output_value(omit = false) #:nodoc: Hirb::View.view_or_page_output(@context.last_value) || non_hirb_view_output end end diff --git a/test/view_test.rb b/test/view_test.rb index 4cf787d..0184201 100644 --- a/test/view_test.rb +++ b/test/view_test.rb @@ -39,6 +39,13 @@ def formatter_config ::IRB::Irb.new(context_stub).output_value end + it "output_value accept omit argument from IRB" do + View.expects(:render_output).once + Hirb.enable + context_stub = stub(:last_value=>'') + ::IRB::Irb.new(context_stub).output_value(true) + end + it "is enabled?" do Hirb.enable View.enabled?.should == true