Sha256: 75e6c85c466d4117ba4fc12b056bd14bd9d2aab3440085ea1632cf2454360db5

Contents?: true

Size: 726 Bytes

Versions: 1

Compression:

Stored size: 726 Bytes

Contents

require "helper"

class TestProxyOwner < Proxies::TestCase
  def setup
    @target = "target"
    @object = mock
    @object.expects(:target_method).at_most_once.returns(@target)
  end

  test "proxy_owner is defined" do
    proxy = Proxy.new(lambda { @object.target_method }, :owner => @object)
    assert_equal @object, proxy.proxy_owner
  end

  test "proxy responds to proxy_owner" do
    proxy = Proxy.new(lambda { @object.target_method }, :owner => @object)
    assert proxy.proxy_respond_to?(:proxy_owner)
  end

  test "proxy does not respond to non_existing_method" do
    proxy = Proxy.new(lambda { @object.target_method }, :owner => @object)
    assert_false proxy.proxy_respond_to?(:non_existing_method)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
proxies-0.2.1 test/test_proxy_owner.rb