spinach-rails 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +7 -0
- data/README.markdown +56 -0
- data/features/rails3/rails_3_1_app.feature +9 -1
- data/features/steps/rails3/rails_3_1_app.rb +9 -3
- data/lib/spinach-rails/railtie.rb +12 -0
- data/lib/spinach-rails/version.rb +1 -1
- data/lib/spinach-rails.rb +2 -0
- data/tasks/spinach.rake +7 -0
- metadata +14 -16
data/Gemfile
CHANGED
data/README.markdown
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# Spinach-rails
|
2
|
+
Spinach-rails is a compatibility layer on top of [Spinach](http://codegram.github.com/spinach)
|
3
|
+
to provide rails support.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
Add `spinach-rails` to your Gemfile:
|
8
|
+
|
9
|
+
group :test do
|
10
|
+
gem 'spinach-rails'
|
11
|
+
end
|
12
|
+
|
13
|
+
Follow the instructions from [Spinach](http://github.com/codegram/spinach) and
|
14
|
+
add the following into `features/support/rails.rb`:
|
15
|
+
|
16
|
+
require 'spinach-rails'
|
17
|
+
ENV['RAILS_ENV']='test'
|
18
|
+
require_relative '../../config/environment'
|
19
|
+
|
20
|
+
## Cleaning your database before each scenario
|
21
|
+
|
22
|
+
You can take benefit from spinach's [hook architecture](http://rdoc.info/github/codegram/spinach/master/Spinach/Hooks)
|
23
|
+
and use DatabaseCleaner to reset your database to a pristine state each time
|
24
|
+
a scenario is executed.
|
25
|
+
|
26
|
+
Here's an example you can append to `features/support/rails.rb`:
|
27
|
+
|
28
|
+
Spinach.hooks.before_scenario do
|
29
|
+
DatabaseCleaner.start
|
30
|
+
end
|
31
|
+
|
32
|
+
Spinach.hooks.after_scenario do
|
33
|
+
DatabaseCleaner.clean
|
34
|
+
end
|
35
|
+
|
36
|
+
## Contributing
|
37
|
+
|
38
|
+
You can easily contribute to Spinach. Its codebase is simple and
|
39
|
+
[extensively documented][documentation].
|
40
|
+
|
41
|
+
* Fork the project.
|
42
|
+
* Make your feature addition or bug fix.
|
43
|
+
* Add specs for it. This is important so we don't break it in a future
|
44
|
+
version unintentionally.
|
45
|
+
* Commit, do not mess with rakefile, version, or history.
|
46
|
+
If you want to have your own version, that is fine but bump version
|
47
|
+
in a commit by itself I can ignore when I pull.
|
48
|
+
* Send me a pull request. Bonus points for topic branches.
|
49
|
+
|
50
|
+
[gherkin]: http://github.com/cucumber/gherkin
|
51
|
+
[cucumber]: http://github.com/cucumber/cucumber
|
52
|
+
[documentation]: http://rubydoc.info/github/codegram/spinach/master/frames
|
53
|
+
|
54
|
+
## License
|
55
|
+
|
56
|
+
MIT License. Copyright 2011 [Codegram Technologies](http://codegram.com)
|
@@ -3,9 +3,17 @@ 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:
|
6
|
+
Scenario: Spinach binary in 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
11
|
When I run spinach
|
11
12
|
Then the features should pass
|
13
|
+
|
14
|
+
Scenario: Spinach rake task in a Rails 3.1 app
|
15
|
+
Given I create a new rails 3 app
|
16
|
+
And I add spinach-rails to it
|
17
|
+
And I add some test features
|
18
|
+
When I run the spinach rake task
|
19
|
+
Then the features should pass
|
@@ -27,6 +27,15 @@ class SpinachRails3_1 < Spinach::FeatureSteps
|
|
27
27
|
last_exit_status.must_equal 0
|
28
28
|
end
|
29
29
|
|
30
|
+
When 'I run the spinach rake task' do
|
31
|
+
run "rake spinach"
|
32
|
+
end
|
33
|
+
|
34
|
+
And "I add an environment file that load rails" do
|
35
|
+
write_file('features/support/env.rb',
|
36
|
+
"require_relative '../../config/application'")
|
37
|
+
end
|
38
|
+
|
30
39
|
private
|
31
40
|
|
32
41
|
def create_rails_app(version = '3.1')
|
@@ -67,9 +76,6 @@ class SpinachRails3_1 < Spinach::FeatureSteps
|
|
67
76
|
end
|
68
77
|
end
|
69
78
|
")
|
70
|
-
write_file('features/support/env.rb',
|
71
|
-
"require 'minitest/spec'
|
72
|
-
require_relative '../../config/application'")
|
73
79
|
end
|
74
80
|
|
75
81
|
end
|
data/lib/spinach-rails.rb
CHANGED
data/tasks/spinach.rake
ADDED
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
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capybara
|
16
|
-
requirement: &
|
16
|
+
requirement: &70322007302800 !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: *
|
24
|
+
version_requirements: *70322007302800
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: spinach
|
27
|
-
requirement: &
|
27
|
+
requirement: &70322007302100 !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: *
|
35
|
+
version_requirements: *70322007302100
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rails
|
38
|
-
requirement: &
|
38
|
+
requirement: &70322007301220 !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: *
|
46
|
+
version_requirements: *70322007301220
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: aruba
|
49
|
-
requirement: &
|
49
|
+
requirement: &70322007300320 !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: *
|
57
|
+
version_requirements: *70322007300320
|
58
58
|
description: spinach-rails adds Rails support to spinach
|
59
59
|
email:
|
60
60
|
- info@codegram.com
|
@@ -66,13 +66,16 @@ files:
|
|
66
66
|
- .rvmrc
|
67
67
|
- .travis.yml
|
68
68
|
- Gemfile
|
69
|
+
- README.markdown
|
69
70
|
- Rakefile
|
70
71
|
- features/rails3/rails_3_1_app.feature
|
71
72
|
- features/steps/rails3/rails_3_1_app.rb
|
72
73
|
- features/support/env.rb
|
73
74
|
- lib/spinach-rails.rb
|
75
|
+
- lib/spinach-rails/railtie.rb
|
74
76
|
- lib/spinach-rails/version.rb
|
75
77
|
- spinach-rails.gemspec
|
78
|
+
- tasks/spinach.rake
|
76
79
|
homepage: http://github.com/codegram/spinach-rails
|
77
80
|
licenses: []
|
78
81
|
post_install_message:
|
@@ -85,18 +88,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
85
88
|
- - ! '>='
|
86
89
|
- !ruby/object:Gem::Version
|
87
90
|
version: '0'
|
88
|
-
segments:
|
89
|
-
- 0
|
90
|
-
hash: -3958383377693729444
|
91
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
92
|
none: false
|
93
93
|
requirements:
|
94
94
|
- - ! '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
-
segments:
|
98
|
-
- 0
|
99
|
-
hash: -3958383377693729444
|
100
97
|
requirements: []
|
101
98
|
rubyforge_project:
|
102
99
|
rubygems_version: 1.8.6
|
@@ -107,3 +104,4 @@ test_files:
|
|
107
104
|
- features/rails3/rails_3_1_app.feature
|
108
105
|
- features/steps/rails3/rails_3_1_app.rb
|
109
106
|
- features/support/env.rb
|
107
|
+
has_rdoc:
|