kelp 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.md +12 -0
- data/README.md +6 -4
- data/examples/sinatra_app/views/form.erb +7 -5
- data/kelp.gemspec +1 -1
- data/lib/generators/kelp/steps/steps_generator.rb +2 -5
- metadata +4 -5
- data/rails_generators/kelp/templates/capybara_steps.rb +0 -16
data/History.md
CHANGED
data/README.md
CHANGED
@@ -97,23 +97,25 @@ for more information.
|
|
97
97
|
Rails generator
|
98
98
|
---------------
|
99
99
|
|
100
|
-
Kelp provides a generator for Rails
|
100
|
+
Kelp provides a generator for Rails projects, which writes step definitions
|
101
101
|
to `features/step_definitions/web_steps.rb`. This file provides all of the same
|
102
102
|
step definitions normally provided by
|
103
103
|
[cucumber-rails](http://github.com/aslakhellesoy/cucumber-rails), with several
|
104
104
|
enhancements. If you have made customizations to your `web_steps.rb`, they will
|
105
105
|
be overwritten! Consider yourself warned.
|
106
106
|
|
107
|
-
To generate `web_steps.rb`,
|
107
|
+
To generate `web_steps.rb`, run this for Rails 2.x:
|
108
108
|
|
109
109
|
$ script/generate kelp
|
110
110
|
|
111
|
+
Or this for Rails 3.x:
|
112
|
+
|
113
|
+
$ rails generate kelp:steps
|
114
|
+
|
111
115
|
*Note*: If you are upgrading from a version of Kelp prior to 0.1.9, you should
|
112
116
|
remove `kelp_steps.rb` from your `features/step_definitions` directory; these
|
113
117
|
are obsolete, and conflict with the newer step definitions in `web_steps.rb`.
|
114
118
|
|
115
|
-
A Rails 3.x generator is not currently provided. Contributions are welcome!
|
116
|
-
|
117
119
|
|
118
120
|
Development
|
119
121
|
-----------
|
@@ -1,3 +1,4 @@
|
|
1
|
+
<!DOCTYPE html>
|
1
2
|
<html>
|
2
3
|
<head><title>Form</title></head>
|
3
4
|
<body>
|
@@ -15,7 +16,8 @@
|
|
15
16
|
</p>
|
16
17
|
<p>
|
17
18
|
<label for="biography">Life story</label>
|
18
|
-
<textarea id="biography" cols="80" rows="10"
|
19
|
+
<textarea id="biography" cols="80" rows="10">
|
20
|
+
</textarea>
|
19
21
|
</p>
|
20
22
|
<p>
|
21
23
|
<label for="height">Height</label>
|
@@ -33,9 +35,9 @@
|
|
33
35
|
<option value="heavy">Heavy</option>
|
34
36
|
</select>
|
35
37
|
</p>
|
36
|
-
<p><button value="Submit person form
|
37
|
-
</
|
38
|
-
</
|
38
|
+
<p><button value="submit_person_form">Submit person form</button></p>
|
39
|
+
</form>
|
40
|
+
</div>
|
39
41
|
|
40
42
|
<div id="spouse_form">
|
41
43
|
<form action="/thanks" method="get">
|
@@ -47,7 +49,7 @@
|
|
47
49
|
<label for="spouse_last_name">Last name</label>
|
48
50
|
<input id="spouse_last_name" type="text" />
|
49
51
|
</p>
|
50
|
-
<p><button value="Submit spouse form
|
52
|
+
<p><button value="submit_spouse_form">Submit spouse form</button></p>
|
51
53
|
</form>
|
52
54
|
</div>
|
53
55
|
|
data/kelp.gemspec
CHANGED
@@ -2,13 +2,10 @@ require 'rails/generators'
|
|
2
2
|
|
3
3
|
module Kelp
|
4
4
|
class StepsGenerator < Rails::Generators::Base
|
5
|
+
source_root File.expand_path('../templates', __FILE__)
|
6
|
+
|
5
7
|
def generate
|
6
8
|
copy_file 'web_steps.rb', 'features/step_definitions/web_steps.rb'
|
7
9
|
end
|
8
|
-
|
9
|
-
def self.source_root
|
10
|
-
File.join(File.dirname(__FILE__), 'templates')
|
11
|
-
end
|
12
10
|
end
|
13
11
|
end
|
14
|
-
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kelp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Eric Pierce
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-10-22 00:00:00 -06:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -175,7 +175,6 @@ files:
|
|
175
175
|
- lib/kelp/visibility.rb
|
176
176
|
- lib/kelp/xpath.rb
|
177
177
|
- rails_generators/kelp/kelp_generator.rb
|
178
|
-
- rails_generators/kelp/templates/capybara_steps.rb
|
179
178
|
- rails_generators/kelp/templates/web_steps.rb
|
180
179
|
- spec/attribute_spec.rb
|
181
180
|
- spec/checkbox_spec.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
|
2
|
-
# May not be needed?
|
3
|
-
#require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
4
|
-
#require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "selectors"))
|
5
|
-
|
6
|
-
# Single-line step scoper
|
7
|
-
When /^(.*) within ([^:]+)$/ do |step, parent|
|
8
|
-
scope_within(parent) { When step }
|
9
|
-
end
|
10
|
-
|
11
|
-
# Multi-line step scoper
|
12
|
-
When /^(.*) within ([^:]+):$/ do |step, parent, table_or_string|
|
13
|
-
scope_within(parent) { When "#{step}:", table_or_string }
|
14
|
-
end
|
15
|
-
|
16
|
-
|