Displaying 1 result from an estimated 1 matches for "anonymous_class".
2007 Aug 14
4
(no subject)
How would you spec out something like the following:
def a_method
x = Class.new do
include Enumerable
end
# do something here with x
end
describe "The Anonymous Class" do
before :each do
@anonymous_class = mock Class
Class.stub!(:new).and_return @anonymous_class
end
it "should create a new anonymous class" do
Class.should_receive(:new)
a_method
end
it "should include Enumerable" do
#... what goes here?
end
end
One thought I''ve had...