spec/gitscrub/level_spec.rb in gitscrub-0.0.3 vs spec/gitscrub/level_spec.rb in gitscrub-0.0.4
- old
+ new
@@ -5,10 +5,13 @@
before(:each) do
@file = <<-eof
difficulty 1
description "A test description"
+setup do
+ "test"
+end
solution do
Grit::Repo.new("gitscrub/notadir")
end
eof
File.stub(:read).and_return(@file)
@@ -34,8 +37,20 @@
end
it "should return true if the requirements have been met" do
Grit::Repo.stub(:new).and_return(true)
@level.solve.should eql(true)
+ end
+
+ it "should display a full description" do
+ Gitscrub::UI.stub(:puts)
+ Gitscrub::UI.should_receive(:puts).with("Level: 1")
+ Gitscrub::UI.should_receive(:puts).with("Difficulty: *")
+ Gitscrub::UI.should_receive(:puts).with(@level.ldescription)
+ @level.full_description
+ end
+
+ it "should call setup" do
+ @level.setup_level.should eql("test")
end
end