Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

cucumber features: add, delete, init

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

0 comments on commit 20d4ce9

Please sign in to comment.
Something went wrong with that request. Please try again.