Permalink
Browse files

Remove turnip steps

  • Loading branch information...
1 parent fb93bb2 commit 132d6c42cce523e1880f1eb2859bce5c38f45144 @paulelliott committed Mar 6, 2013
View
@@ -1,3 +1,2 @@
--colour
--backtrace
--r turnip
View
@@ -115,4 +115,3 @@ DEPENDENCIES
rspec
sequel
sqlite3
- turnip (>= 0.3)
View
@@ -8,8 +8,4 @@ Cucumber::Rake::Task.new(:cucumber) do |t|
t.cucumber_opts = "--format progress --tags ~@wip"
end
-RSpec::Core::RakeTask.new(:turnip) do |spec|
- spec.pattern = "turnip/**/*.feature"
-end
-
-task :default => [:spec, :cucumber, :turnip]
+task :default => [:spec, :cucumber]
View
@@ -25,7 +25,6 @@ Gem::Specification.new do |s|
s.add_development_dependency("dm-core")
s.add_development_dependency("dm-migrations")
s.add_development_dependency("dm-sqlite-adapter")
- s.add_development_dependency("turnip", [">= 0.3"])
s.add_development_dependency("ffaker")
s.add_development_dependency("keymaker")
s.add_development_dependency("mongoid")
@@ -1,57 +0,0 @@
-placeholder :fabrication_count do
- match /\d+/ do |count|
- count.to_i
- end
- match /a/ do
- 1
- end
- match /no/ do
- 0
- end
-end
-
-steps_for :global do
- def with_ivars(fabricator)
- @they = yield fabricator
- instance_variable_set("@#{fabricator.model}", @they)
- end
-
- step ':fabrication_count :model_name' do |count, model_name|
- with_ivars Fabrication::Cucumber::StepFabricator.new(model_name) do |fab|
- fab.n(count)
- end
- end
-
- step 'the following :model_name:' do |model_name, table|
- with_ivars Fabrication::Cucumber::StepFabricator.new(model_name) do |fab|
- fab.from_table(table)
- end
- end
-
- step 'that :parent has the following :child:' do |parent, child, table|
- with_ivars Fabrication::Cucumber::StepFabricator.new(child, :parent => parent) do |fab|
- fab.from_table(table)
- end
- end
-
- step 'that :parent has :fabrication_count :child' do |parent, count, child|
- with_ivars Fabrication::Cucumber::StepFabricator.new(child, :parent => parent) do |fab|
- fab.n(count)
- end
- end
-
- step 'that/those :children belong/belongs to that :parent' do |children, parent|
- with_ivars Fabrication::Cucumber::StepFabricator.new(parent) do |fab|
- fab.has_many(children)
- end
- end
-
- step 'I should see :fabrication_count :model_name in the database' do |count, model_name|
- Fabrication::Cucumber::StepFabricator.new(model_name).klass.count.should == count
- end
-
- step 'I should see the following :model_name in the database:' do |model_name, table|
- klass = Fabrication::Cucumber::StepFabricator.new(model_name).klass
- klass.where(table.rows_hash).count.should == 1
- end
-end
@@ -1,23 +0,0 @@
-require 'rails/generators/base'
-
-module Fabrication
- module Generators
- class TurnipStepsGenerator < Rails::Generators::Base
- argument :step_dir, :type => :string, :default => "spec/acceptance/steps/"
-
- def generate
- template 'fabrication_steps.rb', turnip_step_directory
- end
-
- def self.source_root
- @_fabrication_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
- end
-
- private
-
- def turnip_step_directory
- File.join(step_dir, 'fabrication_steps.rb')
- end
- end
- end
-end
View
@@ -7,7 +7,6 @@
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
RSpec.configure do |config|
- Turnip::Config.step_dirs = ['turnip', File.expand_path('lib/rails/generators/fabrication/turnip_steps/templates/')]
config.before(:each) do
TestMigration.up
clear_mongodb
@@ -1,177 +0,0 @@
-Feature: Active Record Objects
-
- Scenario: some generic objects
- Given 5 divisions
- Then I should see 5 divisions in the database
-
- Scenario: a single detailed object
- Given the following division:
- | name | Rasczak's Roughnecks |
- Then I should see 1 division in the database
- And I should see the following division in the database:
- | name | Rasczak's Roughnecks |
-
- Scenario: multiple detailed objects
- Given the following divisions:
- | name |
- | Red Squadron |
- | Yellow Squadron |
- Then I should see 2 divisions in the database
- And I should see the following division in the database:
- | name | Red Squadron |
- And I should see the following division in the database:
- | name | Yellow Squadron |
-
- Scenario: a single object with transform to apply
- Given the following company:
- | name | Widgets Inc |
- Given the following division:
- | name | Southwest |
- | company | Widgets Inc |
- Then that division should reference that company
-
- Scenario: multiple objects with transform to apply
- Given the following company:
- | name | Widgets Inc |
- Given the following divisions:
- | name | company |
- | Southwest | Widgets Inc |
- | North | Widgets Inc |
- Then they should reference that company
-
- Scenario: a parented single generic object
- Given 1 company
- And that company has 1 division
- Then I should see 1 company in the database
- And I should see 1 division in the database
-
- Scenario: a parented single detailed object
- Given 1 company
- And that company has the following division:
- | name | Everyone |
- Then I should see 1 company in the database
- And I should see 1 division in the database
- And I should see the following division in the database:
- | name | Everyone |
- And that division should reference that company
-
- Scenario: a parented single detailed object with inheritance
- Given 1 company
- And that company has the following squadron:
- | name | Everyone |
- Then I should see 1 company in the database
- And I should see 1 squadron in the database
- And I should see the following division in the database:
- | name | Everyone |
- And that squadron should reference that company
-
- Scenario: a parented single detailed object whose parent has inheritance
- Given 1 startup
- And that startup has the following division:
- | name | Everyone |
- Then I should see 1 startup in the database
- And I should see 1 division in the database
- And I should see the following division in the database:
- | name | Everyone |
- And that division should reference that startup
-
- Scenario: multiple parented detailed objects
- Given 1 company
- And that company has the following divisions:
- | name |
- | Red Squadron |
- | Yellow Squadron |
- Then I should see 1 company in the database
- And I should see 2 divisions in the database
- And I should see the following division in the database:
- | name | Red Squadron |
- And I should see the following division in the database:
- | name | Yellow Squadron |
- And they should reference that company
-
- Scenario: multiple parented detailed objects with inheritance
- Given 1 company
- And that company has the following squadrons:
- | name |
- | Red Squadron |
- | Yellow Squadron |
- Then I should see 1 company in the database
- And I should see 2 squadrons in the database
- And I should see the following division in the database:
- | name | Red Squadron |
- And I should see the following division in the database:
- | name | Yellow Squadron |
- And they should reference that company
-
- Scenario: multiple parented detailed objects whose parent has inheritance
- Given 1 startup
- And that startup has the following divisions:
- | name |
- | Red Squadron |
- | Yellow Squadron |
- Then I should see 1 startup in the database
- And I should see 2 divisions in the database
- And I should see the following division in the database:
- | name | Red Squadron |
- And I should see the following division in the database:
- | name | Yellow Squadron |
- And they should reference that startup
-
- Scenario: a generic parent from the child
- Given 1 division
- And that division has 1 company
- Then I should see 1 division in the database
- And I should see 1 company in the database
- And that division should reference that company
-
- Scenario: a detailed parent from the child
- Given 1 division
- And that division has the following company:
- | name | Hashrocket |
- Then I should see 1 division in the database
- And I should see 1 company in the database
- And I should see the following company in the database:
- | name | Hashrocket |
- And that division should reference that company
-
- Scenario: a parent with inheritance from the child
- Given 1 division
- And that division has the following startup:
- | name | Hashrocket |
- Then I should see 1 startup in the database
- And I should see 1 division in the database
- And I should see the following company in the database:
- | name | Hashrocket |
- And that division should reference that startup
-
- Scenario: a child belongs to a parent
- Given 1 company
- And 1 division
- And that division belongs to that company
- Then I should see 1 division in the database
- And I should see 1 company in the database
- And that division should reference that company
-
- Scenario: an inherited child belongs to a parent
- Given 1 company
- And 1 squadron
- And that squadron belongs to that company
- Then I should see 1 squadron in the database
- And I should see 1 company in the database
- And that squadron should reference that company
-
- Scenario: a child belongs to an inherited parent
- Given 1 startup
- And 1 division
- And that division belongs to that startup
- Then I should see 1 division in the database
- And I should see 1 startup in the database
- And that division should reference that startup
-
- Scenario: children belong to a parent
- Given 1 company
- And 2 divisions
- And those divisions belong to that company
- Then I should see 1 company in the database
- And I should see 2 divisions in the database
- And they should reference that company
View
@@ -1,5 +0,0 @@
-Feature: Not ORM specific
-
- Scenario: fabricator doesn't exist
- When I try to fabricate "god"
- Then it should tell me that it isn't defined
@@ -1,68 +0,0 @@
-Feature: Mongoid Objects
-
- Scenario: for some generic objects
- Given 5 authors
- Then I should see 5 authors in the database
-
- Scenario: a single detailed object
- Given the following author:
- | name | George Orwell |
- Then I should see 1 author in the database
- And I should see the following author in the database:
- | name | George Orwell |
-
- Scenario: a single detailed object with a multi-word name
- Given the following "publishing house":
- | name | Random House |
- Then I should see 1 "publishing house" in the database
- And I should see the following "publishing house" in the database:
- | name | Random House |
-
- Scenario: multiple detailed objects
- Given the following authors:
- | name |
- | Dr. Seuss |
- | Shel Silverstein |
- Then I should see 2 authors in the database
- And I should see the following author in the database:
- | name | Dr. Seuss |
- And I should see the following author in the database:
- | name | Shel Silverstein |
-
- Scenario: a parented single detailed object
- Given 1 author
- And that author has the following book:
- | title | 1984 |
- Then I should see 1 author in the database
- And that book should be persisted
- And that book should have "1984" for a "title"
- And that book should reference that author
-
- Scenario: a parented object with a multi-word name
- Given 1 "publishing house"
- And that "publishing house" has the following "book promoter":
- | name | Vinnie |
- Then I should see 1 "publishing house" in the database
- And that "book promoter" should be persisted
- And that "book promoter" should have "Vinnie" for a "name"
- And that "book promoter" should reference that "publishing house"
-
- Scenario: a multi-word child belongs to a multi-word parent
- Given 1 "publishing house"
- And 1 "professional affiliation"
- And that "publishing house" belongs to that "professional affiliation"
- Then I should see 1 "publishing house" in the database
- And I should see 1 "professional affiliation" in the database
- And that "publishing house" should reference that "professional affiliation"
-
- Scenario: multiple parented detailed objects
- Given 1 author
- And that author has the following books:
- | title |
- | 1984 |
- | Animal Farm |
- Then I should see 1 author in the database
- And they should be persisted
- And they should reference that author
- And the first should have "1984" for a "title"
- And the second should have "Animal Farm" for a "title"
Oops, something went wrong. Retry.

0 comments on commit 132d6c4

Please sign in to comment.