spec/bogus/copies_classes_spec.rb in bogus-0.0.4 vs spec/bogus/copies_classes_spec.rb in bogus-0.1.0

- old
+ new

@@ -49,14 +49,10 @@ subject.should respond_to(:baa) subject.baa('hello') subject.baa('hello') {} end - - it "makes the methods chainable" do - subject.foo.bar('hello').baz('hello', 'world', 'foo').bam.baa('foo') - end end let(:copies_classes) { Bogus.inject.copies_classes } let(:fake_class) { copies_classes.copy(klass) } let(:fake) { fake_class.new } @@ -75,14 +71,25 @@ context "constructors" do let(:klass) { Class.new do def initialize(hello) end + + def foo + end end } - it "adds a constructor that allows passing any number of arguments" do - fake_class.new('hello', 'w', 'o', 'r', 'l', 'd') { test } + it "adds a no-arg constructor" do + instance = fake_class.__create__ + + instance.should respond_to(:foo) + end + + it "adds a constructor that allows passing the correct number of arguments" do + instance = fake_class.new('hello') + + instance.should respond_to(:foo) end end class ClassWithClassMethods extend SampleMethods