Skip to content

Commit

Permalink
first passing cuke
Browse files Browse the repository at this point in the history
  • Loading branch information
cheezy committed Sep 26, 2011
1 parent 8cdb38f commit 1823141
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 38 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.bundle
Gemfile.lock
pkg/*
tmp
3 changes: 2 additions & 1 deletion bin/testgen
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env ruby

print "nothing"
require 'testgen/cli'
TestGen::CLI.start
3 changes: 2 additions & 1 deletion cucumber.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
default: --no-source
default: --no-source --color --format pretty
autotest: --no-source --color --format pretty
6 changes: 6 additions & 0 deletions features/support/hooks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require 'fileutils'

After do
dir = File.join(File.dirname(__FILE__), '../../', 'tmp/aruba/sample')
FileUtils.rm_rf dir
end
8 changes: 5 additions & 3 deletions features/testgen_project.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Feature: Generating a project with TestGen

Scenario: Generating the directory structure
When I run `testgen sample`
Then the output should contain "generating sample directory"
Scenario: Generating the top level project directory
When I run `testgen project sample`
Then a directory named "sample" should exist


5 changes: 1 addition & 4 deletions lib/testgen.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
require "testgen/version"

module TestGen
# Your code goes here...
end
require 'testgen/cli'
11 changes: 11 additions & 0 deletions lib/testgen/cli.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'thor'
require 'testgen/generators/project'

module TestGen
class CLI < Thor
desc "project <project_name>", "Create a new test project"
def project(name)
TestGen::Generators::Project.start([name])
end
end
end
21 changes: 21 additions & 0 deletions lib/testgen/generators/project.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require 'thor/group'

module TestGen
module Generators
class Project < Thor::Group
include Thor::Actions

argument :name, :type => :string, :desc => 'The name of the project'
desc "Generates a project structure for testing with Cucumber"

def self.source_root
File.dirname(__FILE__)
end

def create_top_directory
empty_directory(name)
end

end
end
end
29 changes: 0 additions & 29 deletions lib/testgen/generators/project/project_generator.rb

This file was deleted.

0 comments on commit 1823141

Please sign in to comment.