Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initialize feature, Scenario create default .todotxt.cfg

  • Loading branch information...
commit 990de0c36a88ab8ec57fa6f240662e67c4729cf9 1 parent 48becba
Bèr Kessels authored
View
1  .gitignore
@@ -3,3 +3,4 @@
Gemfile.lock
pkg/*
coverage/*
+tmp/*
View
6 bin/todotxt
@@ -5,9 +5,9 @@ $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
args = ARGV.clone
-if args.empty?
- args.push "ls"
-end
+#if args.empty?
+ #args.push "ls"
+#end
require "todotxt"
Todotxt::CLI.start(args)
View
17 features/initialize.feature
@@ -0,0 +1,17 @@
+Feature: Initialize
+
+ So that I can start using todotxt
+ As a new user
+ I want to set up example files
+
+ Background:
+ Given a home directory
+
+ Scenario: todotxt
+ When I run `todotxt` interactively
+ And I type "yes"
+ Then it should pass with:
+ """
+ You need a .todotxt.cfg file in your home folder to continue (used to determine the path of your todo.txt.) Answer yes to have it generated for you (pointing to ~/todo.txt), or no to create it yourself.
+ """
+ And a file named ".todotxt.cfg" should exist
View
3  features/step_definitions/environment_steps.rb
@@ -0,0 +1,3 @@
+Given /^a home directory$/ do
+ step %{a directory named "home"}
+end
View
2  lib/todotxt/cli.rb
@@ -273,7 +273,7 @@ def ask_and_create_conf
confirm_generate = yes? "Create ~/.todotxt.cfg? [y/N]"
if confirm_generate
- @cfg.generate!
+ @config.generate!
else
puts ""
exit
View
2  lib/todotxt/config.rb
@@ -25,7 +25,7 @@ def files
end
def generate!
- FileUtils.copy "conf/todotxt.cfg", @config_path
+ FileUtils.copy File.join(File.dirname(File.expand_path(__FILE__)), "..", "..", "conf", "todotxt.cfg"), @config_path
end
private
Please sign in to comment.
Something went wrong with that request. Please try again.