Permalink
Browse files

Add sample easyb test

  • Loading branch information...
esumerfd committed Aug 4, 2011
1 parent a943202 commit 58700a51a335358c2e2d70cd978d3e74948365fa
@@ -0,0 +1,37 @@
+package org.bitbashers.easyb.story
+
+scenario "easby stories",{
+
+ given "a story",{
+ story = [name: "story name"]
+ }
+ when "story has a description", { story.description = "this is a cool story" }
+ then "it is accessible", { story.description.shouldBe "this is a cool story" }
+}
+
+scenario "before", {
+ before "an it", {
+ story = [name: "before"]
+ }
+ then "can access to the story", { story.shouldNotBe null }
+}
+
+scenario "root before", {
+ before "default value", { story = "default" }
+ then "is the default", { story.shouldBe "default" }
+
+ scenario "nested before", {
+ before "alternate value", { story = "alternate" }
+ then "should be alternate", { story.shouldBe "alternate" }
+ }
+}
+
+scenario "nested", {
+ scenario "initial scenario", {
+ given "a story", { nestedStory = true }
+ }
+
+ scenario "separate", {
+ then "story is not accessible", { nestedStory.shouldBe null }
+ }
+}
@@ -0,0 +1,13 @@
+package org.bitbashers.easyb.story
+
+scenario "fred can be assigned", {
+
+ before "user", { fred = 2 }
+
+ scenario "starts at 1", {
+
+ given "fred", { fred = 1}
+
+ then "is one", { fred.shouldBe 1 }
+ }
+}

0 comments on commit 58700a5

Please sign in to comment.