Browse files

cucumber features: add, delete, init

  • Loading branch information...
1 parent c9c4332 commit 20d4ce978c2b72a73463385d56db93dcc05fb283 @rafmagana committed Nov 15, 2010
View
12 features/adding_items.feature
@@ -0,0 +1,12 @@
+Feature: Adding items
+ In order to add items
+ I want to use dooby add command
+
+Scenario: Add items
+ Given dooby have been already initialized
+ When I run "dooby add 'this is an #item'"
+ Then the output should contain "Item added!"
+ When I run "dooby list"
+ Then the output should contain "e10782"
+ And the output should contain "this is an"
+ And the output should contain "#item"
View
10 features/deleting_items.feature
@@ -0,0 +1,10 @@
+Feature: Deleting items
+ In order to delete items
+ I want to use the 'dooby delete' command
+
+Scenario: Delete an item
+ Given dooby have been already initialized
+ And I run "dooby add 'this is an #item'"
+ When I run "dooby delete" interactively
+ When I type "e10782"
+ Then the output should contain "e10782 deleted..."
View
21 features/initialize_dooby.feature
@@ -0,0 +1,21 @@
+Feature: Dooby initializes file .dooby/list.yml
+ In order to be able to add items
+ I want to have a .dooby/list.yml file to store my items
+
+Scenario: Initialize dooby
+ Given dooby haven't been initialized
+ When I run "dooby init"
+ Then the following files should exist:
+ |.dooby/list.yml|
+ Then the output should contain:
+ """
+ Created a new todo list inside this directory
+ """
+
+Scenario: Don't initialize if it has been already initialized
+ Given dooby have been already initialized
+ When I run "dooby init"
+ Then the output should contain:
+ """
+ Todo list already exists inside this directory
+ """
View
7 features/step_definitions/dooby_steps.rb
@@ -0,0 +1,7 @@
+Given /^dooby haven't been initialized$/ do
+ check_file_presence([".dooby/list.yml"], false)
+end
+
+Given /^dooby have been already initialized$/ do
+ run(unescape("dooby init"), false)
+end
View
13 features/support/env.rb
@@ -0,0 +1,13 @@
+require 'aruba'
+
+module ArubaExtensions
+ def detect_ruby(cmd)
+ if cmd =~ /^dooby/
+ "ruby -I../../lib -S ../../bin/#{cmd}"
+ else
+ super(cmd)
+ end
+ end
+end
+
+World(ArubaExtensions)

0 comments on commit 20d4ce9

Please sign in to comment.