test/result_test.rb in track_changes-0.5.0 vs test/result_test.rb in track_changes-0.5.1

- old
+ new

@@ -1,35 +1,35 @@ -require File.dirname(__FILE__) + '/test_helper' - -class ResultTest < Test::Unit::TestCase - context "a Result instance" do - setup do - @controller = mock() - @changes = { "attr" => ["old", "new"] } - - @filter = TrackChanges::Result.new(:model, @controller, @changes) - end - - should "define given symbol as method" do - @controller.expects(:instance_variable_get).with() {|v| v == "@model"}.returns(:ivar_result) - assert_equal :ivar_result, @filter.model - end - - should "send method_missing calls to controller" do - @controller.expects(:bogus_method).returns(:got_it) - assert_equal :got_it, @filter.bogus_method - end - - should "get @current_user from controller" do - @controller.expects(:instance_variable_get).with() {|v| v == "@current_user"}.returns(:ivar_result) - assert_equal :ivar_result, @filter.current_user - end - - should "return changes" do - assert_equal @changes, @filter.changes - end - - should "return controller" do - assert_equal @controller, @filter.controller - end - end -end +require File.dirname(__FILE__) + '/test_helper' + +class ResultTest < Test::Unit::TestCase + context "a Result instance" do + setup do + @controller = mock() + @changes = { "attr" => ["old", "new"] } + + @filter = TrackChanges::Result.new(:model, @controller, @changes) + end + + should "define given symbol as method" do + @controller.expects(:instance_variable_get).with() {|v| v == "@model"}.returns(:ivar_result) + assert_equal :ivar_result, @filter.model + end + + should "send method_missing calls to controller" do + @controller.expects(:bogus_method).returns(:got_it) + assert_equal :got_it, @filter.bogus_method + end + + should "get @current_user from controller" do + @controller.expects(:instance_variable_get).with() {|v| v == "@current_user"}.returns(:ivar_result) + assert_equal :ivar_result, @filter.current_user + end + + should "return changes" do + assert_equal @changes, @filter.changes + end + + should "return controller" do + assert_equal @controller, @filter.controller + end + end +end