Sha256: 78a6078099a279d018c0d43492033674e3367e610de2acb5c165cb22bae0b982
Contents?: true
Size: 516 Bytes
Versions: 12
Compression:
Stored size: 516 Bytes
Contents
require 'spec_helper' describe :clojures_and_scoping do class Foo def a_method :inside end def evaluate(lamb) if RUBY_VERSION <= "1.9" self.instance_eval(&lamb) else self.instance_exec(&lamb) end end end specify "when no name clash" do Foo.new.evaluate(lambda{ a_method }).should == :inside end specify "with name clash" do a_method = :outside Foo.new.evaluate(Proc.new{ a_method }).should == :outside end end
Version data entries
12 entries across 12 versions & 2 rubygems