Permalink
Browse files

add some Task tests

  • Loading branch information...
1 parent 2aa1344 commit 2e90fa749b44a0ba33b789c7d113dcaa3029675c @bakkdoor bakkdoor committed May 16, 2012
Showing with 26 additions and 0 deletions.
  1. +26 −0 tests/task.fy
View
@@ -0,0 +1,26 @@
+require: "lib/fake"
+
+FancySpec describe: Fake Task with: {
+ def task: block ({}) {
+ Fake Task new: @{
+ name: "foo"
+ block: block
+ }
+ }
+
+ it: "didn't run yet after creation" with: 'ran? when: {
+ task_ran? = false
+ t = task: { task_ran? = true }
+ t ran? is: false
+ task_ran? is: false
+ }
+
+ it: "runs the task correctly" with: 'run when: {
+ task_ran? = false
+ t = task: { task_ran? = true }
+ t ran? is: false
+ t run
+ t ran? is: true
+ task_ran? is: true
+ }
+}

0 comments on commit 2e90fa7

Please sign in to comment.