spinach-rails 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -6,7 +6,7 @@ to provide rails support.
6
6
 
7
7
  Add `spinach-rails` to your Gemfile:
8
8
 
9
- group :test do
9
+ group :test, :development do
10
10
  gem 'spinach-rails'
11
11
  end
12
12
 
@@ -7,7 +7,7 @@ Feature: Spinach works with a Rails 3.1 app
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
10
- And I add an environment file that load rails
10
+ And I run the generator
11
11
  When I run spinach
12
12
  Then the features should pass
13
13
 
@@ -15,6 +15,7 @@ Feature: Spinach works with a Rails 3.1 app
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
+ And I run the generator
18
19
  When I run the spinach rake task
19
20
  Then the features should pass
20
21
 
@@ -22,5 +23,6 @@ Feature: Spinach works with a Rails 3.1 app
22
23
  Given I create a new rails 3 app
23
24
  And I add spinach-rails to it
24
25
  And I add a test feature file without a steps file
26
+ And I run the generator
25
27
  When I run the spinach:generate rake task
26
28
  Then a feature steps file should have been generated
@@ -8,6 +8,6 @@ Feature: Spinach adds the route helpers
8
8
  And I add spinach-rails to it
9
9
  And I add an initilizer that defines a constant
10
10
  And I add a test to assert if the constant is defined
11
- And I add an environment file that load rails
11
+ And I run the generator
12
12
  When I run spinach
13
13
  Then the features should pass
@@ -18,16 +18,16 @@ module RailsFixtures
18
18
 
19
19
  When "I run spinach" do
20
20
  run "spinach"
21
+ stop_processes!
21
22
  end
22
23
 
23
24
  Then "the features should pass" do
24
- stop_processes!
25
25
  last_exit_status.must_equal 0
26
26
  end
27
27
 
28
- And "I add an environment file that load rails" do
29
- write_file('features/support/env.rb',
30
- "require_relative '../../config/environment'")
28
+ And "I run the generator" do
29
+ run "bundle exec rails g spinach:rails"
30
+ stop_processes!
31
31
  end
32
32
 
33
33
  private
@@ -54,7 +54,7 @@ module RailsFixtures
54
54
 
55
55
  def add_spinach_rails
56
56
  append_to_file("Gemfile",
57
- "gem 'spinach-rails', group: :test, path: '#{Dir.pwd}'")
57
+ "gem 'spinach-rails', group: [:test, :development], path: '#{Dir.pwd}'")
58
58
  run "bundle install"
59
59
  end
60
60
 
data/lib/spinach-rails.rb CHANGED
@@ -5,7 +5,6 @@ require 'capybara'
5
5
  require 'capybara/dsl'
6
6
 
7
7
  require "spinach-rails/railtie"
8
- require "spinach-rails/generators"
9
8
 
10
9
  Spinach.hooks.before_run do
11
10
  require 'spinach/capybara'
@@ -4,7 +4,7 @@ require 'spinach'
4
4
  class Spinach::RailsGenerator < Rails::Generators::Base
5
5
  def create_environment_file
6
6
  create_file "features/support/env.rb", <<-FILE
7
- ENV['RAILS_ENV'] ||= 'test'
7
+ ENV['RAILS_ENV'] = 'test'
8
8
  require './config/environment'
9
9
 
10
10
  require 'minitest/spec'
@@ -8,9 +8,14 @@ module Spinach
8
8
  File.dirname(__FILE__), '..', '..', 'tasks/spinach.rake')
9
9
  )
10
10
  end
11
+
11
12
  initializer "add_routes", after: :after_initialize do |app|
12
13
  routes = app.routes.url_helpers
13
14
  Spinach::FeatureSteps.send(:include, routes)
14
15
  end
16
+
17
+ generators do
18
+ require 'spinach-rails/generators'
19
+ end
15
20
  end
16
21
  end
@@ -1,5 +1,5 @@
1
1
  module Spinach
2
2
  module Rails
3
- VERSION = "0.0.9"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
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.9
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capybara
16
- requirement: &70176368391020 !ruby/object:Gem::Requirement
16
+ requirement: &70364399106900 !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: *70176368391020
24
+ version_requirements: *70364399106900
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: spinach
27
- requirement: &70176368390320 !ruby/object:Gem::Requirement
27
+ requirement: &70364399106200 !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: *70176368390320
35
+ version_requirements: *70364399106200
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: railties
38
- requirement: &70176368389780 !ruby/object:Gem::Requirement
38
+ requirement: &70364399105580 !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: *70176368389780
46
+ version_requirements: *70364399105580
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: aruba
49
- requirement: &70176368389360 !ruby/object:Gem::Requirement
49
+ requirement: &70364399105120 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70176368389360
57
+ version_requirements: *70364399105120
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rails
60
- requirement: &70176368388800 !ruby/object:Gem::Requirement
60
+ requirement: &70364399104480 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70176368388800
68
+ version_requirements: *70364399104480
69
69
  description: spinach-rails adds Rails support to spinach
70
70
  email:
71
71
  - info@codegram.com