请原谅我的小黄瓜
鉴于我有一个名为
Hello
World
world
World
类NameError: uninitialized constant World
module Hello
def world
p "hello world from method"
end
class World
def initialize
p "hello world from class"
end
end
end
describe "hello world" do
include Hello
it "call method" do
world
end
it "call class" do
World.new
end
end
原谅我的小黄瓜,除非你另有目的(因为这还不清楚)
When I create a Hello::World class
Then I get an object of kind Hello::World
it "should not catch fire on instantiation" do
Hello::World.new.should_not be_nil
end