spinach-rails 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -3,9 +3,6 @@ source 'http://rubygems.org'
3
3
  # Specify your gem's dependencies in spinach-rails.gemspec
4
4
  gemspec
5
5
 
6
- gem 'spinach-rails', path: '../spinach-rails'
7
- gem 'spinach', path: '../spinach'
8
-
9
6
  group :test do
10
7
  gem 'yard'
11
8
  end
data/README.markdown CHANGED
@@ -10,12 +10,15 @@ Add `spinach-rails` to your Gemfile:
10
10
  gem 'spinach-rails'
11
11
  end
12
12
 
13
- Follow the instructions from [Spinach](http://github.com/codegram/spinach) and
14
- add the following into `features/support/rails.rb`:
13
+ Follow the instructions from [Spinach](http://github.com/codegram/spinach) to
14
+ set up spinach and run the rake task:
15
15
 
16
- require 'spinach-rails'
17
- ENV['RAILS_ENV']='test'
18
- require_relative '../../config/environment'
16
+ rake spinach
17
+
18
+ If you want spinach to automatically generate a step definition file when
19
+ necessary, you can also run:
20
+
21
+ rake spinach:generate
19
22
 
20
23
  ## Cleaning your database before each scenario
21
24
 
@@ -23,7 +26,7 @@ You can take benefit from spinach's [hook architecture](http://rdoc.info/github/
23
26
  and use DatabaseCleaner to reset your database to a pristine state each time
24
27
  a scenario is executed.
25
28
 
26
- Here's an example you can append to `features/support/rails.rb`:
29
+ Here's an example you can add to a file `features/support/clean_database.rb`:
27
30
 
28
31
  Spinach.hooks.before_scenario do
29
32
  DatabaseCleaner.start
@@ -3,7 +3,7 @@ Feature: Spinach works with a Rails 3.1 app
3
3
  As a developer
4
4
  I want spinach to be fully compatible with Rails 3.1
5
5
 
6
- Scenario: Spinach binary in a Rails 3.1 app
6
+ Scenario: Spinach binary
7
7
  Given I create a new rails 3 app
8
8
  And I add spinach-rails to it
9
9
  And I add some test features
@@ -11,9 +11,16 @@ Feature: Spinach works with a Rails 3.1 app
11
11
  When I run spinach
12
12
  Then the features should pass
13
13
 
14
- Scenario: Spinach rake task in a Rails 3.1 app
14
+ Scenario: Spinach rake task runs spinach
15
15
  Given I create a new rails 3 app
16
16
  And I add spinach-rails to it
17
17
  And I add some test features
18
18
  When I run the spinach rake task
19
19
  Then the features should pass
20
+
21
+ Scenario: Spinach rake task generates feature_steps
22
+ Given I create a new rails 3 app
23
+ And I add spinach-rails to it
24
+ And I add a test feature file without a steps file
25
+ When I run the spinach:generate rake task
26
+ Then a feature steps file should have been generated
@@ -36,6 +36,26 @@ class SpinachRails3_1 < Spinach::FeatureSteps
36
36
  "require_relative '../../config/application'")
37
37
  end
38
38
 
39
+ And 'I add a test feature file without a steps file' do
40
+ write_file('features/test_feature.feature',
41
+ "Feature: Test feature
42
+ Scenario: Test scenario
43
+ Given I am running spinach
44
+ Then It should be all OK
45
+ ")
46
+ end
47
+
48
+ When 'I run the spinach:generate rake task' do
49
+ run "rake spinach:generate"
50
+ end
51
+
52
+ Then 'a feature steps file should have been generated' do
53
+ stop_processes!
54
+ in_current_dir do
55
+ File.exists?('features/steps/test_feature.rb').must_equal true
56
+ end
57
+ end
58
+
39
59
  private
40
60
 
41
61
  def create_rails_app(version = '3.1')
@@ -1,5 +1,5 @@
1
1
  module Spinach
2
2
  module Rails
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
data/tasks/spinach.rake CHANGED
@@ -1,4 +1,12 @@
1
- desc 'runs spinach'
1
+ desc 'runs the whole spinach suite'
2
+ task 'spinach:generate' => :environment do
3
+ ENV['RAILS_ENV']='test'
4
+ cli = Spinach::Cli.new(['--generate'])
5
+ cli.init_reporter
6
+ cli.run
7
+ end
8
+
9
+ desc 'runs spinach and generates feature steps files when necessary'
2
10
  task :spinach => :environment do
3
11
  ENV['RAILS_ENV']='test'
4
12
  cli = Spinach::Cli.new([])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spinach-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-10-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capybara
16
- requirement: &70322007302800 !ruby/object:Gem::Requirement
16
+ requirement: &70243808827820 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70322007302800
24
+ version_requirements: *70243808827820
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: spinach
27
- requirement: &70322007302100 !ruby/object:Gem::Requirement
27
+ requirement: &70243808827100 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.1.5.2
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70322007302100
35
+ version_requirements: *70243808827100
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rails
38
- requirement: &70322007301220 !ruby/object:Gem::Requirement
38
+ requirement: &70243808826020 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '3'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70322007301220
46
+ version_requirements: *70243808826020
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: aruba
49
- requirement: &70322007300320 !ruby/object:Gem::Requirement
49
+ requirement: &70243808825400 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70322007300320
57
+ version_requirements: *70243808825400
58
58
  description: spinach-rails adds Rails support to spinach
59
59
  email:
60
60
  - info@codegram.com