Sha256: e55fb7f148ffdb6fb86743d3cf9f45a57cf3bf191cee11151d797c6ac58b571e
Contents?: true
Size: 608 Bytes
Versions: 20
Compression:
Stored size: 608 Bytes
Contents
require 'spec/spec_helper' describe "Object" do before :all do @orig_version = VERSION Object.send :remove_const, :VERSION Object.const_set :VERSION, "1.8.6" load 'lib/extensions/object.rb' end after :all do Object.send :remove_const, :VERSION Object.const_set :VERSION, @orig_version end it "should execute blocks with args in instance context" do str = "string" class << str def my_singleton_method(arg) arg end end block = Proc.new { |arg| my_singleton_method(arg) } str.instance_exec("foo",&block).should == "foo" end end
Version data entries
20 entries across 20 versions & 4 rubygems