test/oprah/presenter_test.rb in oprah-0.1.1 vs test/oprah/presenter_test.rb in oprah-0.1.2

- old
+ new

@@ -47,10 +47,15 @@ def test_default_view_context_using_initialize presenter = UserPresenter.new(User.new) assert_kind_of ActionView::Context, presenter.view_context end + def test_default_view_context_unique_per_presenter + refute_equal present(User.new).view_context, + present(User.new).view_context + end + def test_method_missing_delegation assert_equal "Foo Bar", present(User.new).name assert_equal "Foo", present(User.new).first_name assert_equal "Bar", present(User.new).last_name end @@ -92,16 +97,20 @@ assert_equal user_presenter, user_presenter refute_equal user_presenter, project refute_equal user_presenter, project_presenter end - private + def test_inspect + user = User.new + presenter = present(user) - def present_many(*args, &block) - Oprah.present_many(*args, &block) + assert_equal user.inspect, presenter.inspect end - def present(*args, &block) - Oprah.present(*args, &block) + def test_to_s + user = User.new + presenter = present(user) + + assert_equal user.to_s, presenter.to_s end end end