Sha256: 7de0531abcfedcdebd02a78fab9756f0b05b8757198b9eca53cdfcd7b9f1eab5

Contents?: true

Size: 386 Bytes

Versions: 2

Compression:

Stored size: 386 Bytes

Contents

describe "the ns object hack router" do
  it "alias method trick works" do
    object = "hello"
    side_effect = false

    object.add_block_method :new_upcase! do
      side_effect = true
    end

    object.instance_eval do
      def upcase!
        new_upcase!
        super
      end
    end

    object.upcase!
    side_effect.should == true
    object.should == "HELLO"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
routable-0.0.2 spec/ns_object_spec.rb
routable-0.0.1 spec/ns_object_spec.rb