Skip to content

Instantly share code, notes, and snippets.

@akatz
Created September 27, 2011 03:51
Show Gist options
  • Save akatz/1244302 to your computer and use it in GitHub Desktop.
Save akatz/1244302 to your computer and use it in GitHub Desktop.
# JRUBY-5026
describe "using a reified block parameter" do
it "returns an instance of the subclass" do
cls = Class.new do
def self.subclass=(subclass)
@subclass = subclass
end
def self.foo(&block)
@subclass.new(&block)
end
end
cls.subclass = @subclass
proc = cls.foo {"hello"}
proc.class.should == @subclass
proc.call.should == "hello"
proc.ok.should == true
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment