Permalink
Browse files

Initial cucumber features

  • Loading branch information...
brennandunn committed Oct 9, 2009
1 parent 1d352ee commit b41bd3d828a0284d2d1d1a65f607947a0c8c559c
Showing with 78 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +21 −0 Rakefile
  3. +8 −0 bin/migrator
  4. +4 −0 features/creating_migrations.feature
  5. +27 −0 features/expansion.feature
  6. +9 −0 features/support/env.rb
  7. +5 −0 lib/migrator.rb
  8. +3 −0 lib/migrator/generator.rb
View
@@ -3,3 +3,4 @@
coverage
rdoc
pkg
+autotest
View
@@ -54,3 +54,24 @@ Rake::RDocTask.new do |rdoc|
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
+
+begin
+ require 'cucumber/rake/task'
+ Cucumber::Rake::Task.new(:features) do |features|
+ features.cucumber_opts = "features --format progress"
+ end
+ namespace :features do
+ Cucumber::Rake::Task.new(:pretty) do |features|
+ features.cucumber_opts = "features --format progress"
+ end
+ end
+rescue LoadError
+ task :features do
+ abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
+ end
+ namespace :features do
+ task :pretty do
+ abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
+ end
+ end
+end
View
@@ -0,0 +1,8 @@
+#!/usr/bin/env ruby
+require 'rubygems'
+require 'optparse'
+
+$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
+require 'migrator'
+
+Migrator.setup(*ARGV)
@@ -0,0 +1,4 @@
+Feature: creating new migrations
+ In order to create a new migration
+ A user should be able to
+ use the Rakefile to create a migration
View
@@ -0,0 +1,27 @@
+Feature: expanding into a project
+ In order to add migration support
+ A user should be able to
+ create migrator directory structure
+
+ Scenario: creating a Rakefile when one doesn't exist
+ Given a working directory
+ And there is no Rakefile
+ When I expand migrator
+
+ Then a Rakefile is created
+ And a DB directory is created
+
+ Scenario: creating a Rakefile when one exists already
+ Given a working directory
+ And there is a Rakefile
+ When I expand migrator
+
+ Then the Rakefile is appended
+ And a DB directory is created
+
+ Scenario: attempting to create a DB directory when one exists
+ Given a working directory
+ And there is a DB directory
+ When I expand migrator
+
+ Then I'm told that "database directory already exists"
View
@@ -0,0 +1,9 @@
+$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
+require 'migrator'
+
+require 'mocha'
+#require 'output_catcher'
+
+require 'test/unit/assertions'
+
+World(Test::Unit::Assertions)
View
@@ -0,0 +1,5 @@
+require 'migrator/generator'
+
+class Migrator
+ extend Generator
+end
@@ -0,0 +1,3 @@
+module Generator
+
+end

0 comments on commit b41bd3d

Please sign in to comment.