pickle 0.2.11 → 0.2.12

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.2.12
2
+
3
+ * 1 bugfix
4
+ * script/generate pickle paths now works correctly with cucumber-rails 0.3.2
5
+
6
+
1
7
  == 0.2.11
2
8
 
3
9
  * 1 improvement
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.11
1
+ 0.2.12
@@ -6,14 +6,14 @@ Feature: allow pickle to generate steps
6
6
 
7
7
  Scenario: script/generate pickle on fresh cuke install
8
8
  Given cucumber has been freshly generated
9
- When I run "script/generate pickle"
9
+ When I run "script/generate pickle -f"
10
10
  Then the file features/support/pickle.rb should exist
11
11
  And the file features/support/pickle.rb should match /require 'pickle\/world'/
12
12
  And the file features/step_definitions/pickle_steps.rb should be identical to the local step_definitions/pickle_steps.rb
13
13
 
14
14
  Scenario: script/generate pickle path on fresh cuke install
15
15
  Given cucumber has been freshly generated
16
- When I run "script/generate pickle path"
16
+ When I run "script/generate pickle path -f"
17
17
  Then the file features/support/pickle.rb should exist
18
18
  And the file features/support/pickle.rb should match /require 'pickle\/world'/
19
19
  And the file features/support/pickle.rb should match /require 'pickle\/path\/world'/
@@ -22,7 +22,7 @@ Feature: allow pickle to generate steps
22
22
 
23
23
  Scenario: script/generate pickle email on fresh cuke install
24
24
  Given cucumber has been freshly generated
25
- When I run "script/generate pickle email"
25
+ When I run "script/generate pickle email -f"
26
26
  Then the file features/support/pickle.rb should exist
27
27
  And the file features/support/pickle.rb should match /require 'pickle\/world'/
28
28
  And the file features/support/pickle.rb should match /require 'pickle\/email\/world'/
@@ -32,7 +32,7 @@ Feature: allow pickle to generate steps
32
32
 
33
33
  Scenario: script/generate pickle path email on fresh cuke install
34
34
  Given cucumber has been freshly generated
35
- When I run "script/generate pickle path email"
35
+ When I run "script/generate pickle path email -f"
36
36
  Then the file features/support/pickle.rb should exist
37
37
  And the file features/support/pickle.rb should be identical to the local support/pickle.rb
38
38
  And the file features/support/pickle.rb should match /require 'pickle\/world'/
@@ -46,7 +46,7 @@ Feature: allow pickle to generate steps
46
46
  Scenario: regenerating pickle
47
47
  Given cucumber has been freshly generated
48
48
  And pickle path email has been freshly generated
49
- When I run "script/generate pickle path email"
49
+ When I run "script/generate pickle path email -f"
50
50
  Then the file features/support/pickle.rb should match /require 'pickle\/world'/
51
51
  And the file features/support/pickle.rb should match /require 'pickle\/path\/world'/
52
52
  And the file features/support/pickle.rb should match /require 'pickle\/email\/world'/
@@ -12,7 +12,7 @@ Given(/^cucumber has been freshly generated$/) do
12
12
  end
13
13
 
14
14
  Given(/^pickle path email has been freshly generated$/) do
15
- `cd #{Rails.root}; script/generate pickle path email`
15
+ `cd #{Rails.root}; script/generate -f pickle paths email`
16
16
  end
17
17
 
18
18
  Given(/^env\.rb already requires (.+)$/) do |file|
@@ -7,17 +7,11 @@ module NavigationHelpers
7
7
  #
8
8
  def path_to(page_name)
9
9
  case page_name
10
-
10
+
11
11
  when /the home\s?page/
12
12
  '/'
13
-
14
- # Add more mappings here.
15
- # Here is an example that pulls values out of the Regexp:
16
- #
17
- # when /^(.*)'s profile page$/i
18
- # user_profile_path(User.find_by_login($1))
19
13
 
20
- # added by script/generate pickle path
14
+ # the following are examples using path_to_pickle
21
15
 
22
16
  when /^#{capture_model}(?:'s)? page$/ # eg. the forum's page
23
17
  path_to_pickle $1
@@ -31,16 +25,23 @@ module NavigationHelpers
31
25
  when /^#{capture_model}(?:'s)? (.+?) page$/ # eg. the forum's posts page
32
26
  path_to_pickle $1, :extra => $2 # or the forum's edit page
33
27
 
34
- when /^the (.+?) page$/ # translate to named route
35
- send "#{$1.downcase.gsub(' ','_')}_path"
36
-
37
- # end added by pickle path
28
+ # Add more mappings here.
29
+ # Here is an example that pulls values out of the Regexp:
30
+ #
31
+ # when /^(.*)'s profile page$/i
32
+ # user_profile_path(User.find_by_login($1))
38
33
 
39
34
  else
40
- raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
41
- "Now, go and add a mapping in #{__FILE__}"
35
+ begin
36
+ page_name =~ /the (.*) page/
37
+ path_components = $1.split(/\s+/)
38
+ self.send(path_components.push('path').join('_').to_sym)
39
+ rescue Object => e
40
+ raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
41
+ "Now, go and add a mapping in #{__FILE__}"
42
+ end
42
43
  end
43
44
  end
44
45
  end
45
46
 
46
- World(NavigationHelpers)
47
+ World(NavigationHelpers)
data/pickle.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pickle}
8
- s.version = "0.2.11"
8
+ s.version = "0.2.12"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ian White"]
12
- s.date = %q{2010-05-13}
12
+ s.date = %q{2010-06-23}
13
13
  s.description = %q{Easy model creation and reference in your cucumber features}
14
14
  s.email = %q{ian.w.white@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -87,7 +87,7 @@ Gem::Specification.new do |s|
87
87
  s.homepage = %q{http://github.com/ianwhite/pickle/tree}
88
88
  s.rdoc_options = ["--charset=UTF-8"]
89
89
  s.require_paths = ["lib"]
90
- s.rubygems_version = %q{1.3.6}
90
+ s.rubygems_version = %q{1.3.7}
91
91
  s.summary = %q{Easy model creation and reference in your cucumber features}
92
92
  s.test_files = [
93
93
  "spec/pickle/adapter_spec.rb",
@@ -106,7 +106,7 @@ Gem::Specification.new do |s|
106
106
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
107
107
  s.specification_version = 3
108
108
 
109
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
109
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
110
110
  else
111
111
  end
112
112
  else
@@ -17,14 +17,7 @@ class PickleGenerator < Rails::Generator::Base
17
17
 
18
18
  if @generate_path_steps
19
19
  pickle_assigns[:pickle_path] = true
20
- current_paths = File.read('features/support/paths.rb')
21
- unless current_paths.include?('#{capture_model}')
22
- if current_paths =~ /^(.*)(\n\s+else\n\s+raise "Can't find.*".*$)/m
23
- pickle_assigns[:current_paths_header] = $1
24
- pickle_assigns[:current_paths_footer] = $2
25
- m.template 'paths.rb', File.join('features/support', 'paths.rb'), :assigns => pickle_assigns, :collision => :force
26
- end
27
- end
20
+ m.template 'paths.rb', File.join('features/support', 'paths.rb')
28
21
  end
29
22
 
30
23
  if @generate_email_steps
@@ -1,5 +1,17 @@
1
- <%= current_paths_header %>
2
- # added by script/generate pickle path
1
+ module NavigationHelpers
2
+ # Maps a name to a path. Used by the
3
+ #
4
+ # When /^I go to (.+)$/ do |page_name|
5
+ #
6
+ # step definition in web_steps.rb
7
+ #
8
+ def path_to(page_name)
9
+ case page_name
10
+
11
+ when /the home\s?page/
12
+ '/'
13
+
14
+ # the following are examples using path_to_pickle
3
15
 
4
16
  when /^#{capture_model}(?:'s)? page$/ # eg. the forum's page
5
17
  path_to_pickle $1
@@ -13,8 +25,23 @@
13
25
  when /^#{capture_model}(?:'s)? (.+?) page$/ # eg. the forum's posts page
14
26
  path_to_pickle $1, :extra => $2 # or the forum's edit page
15
27
 
16
- when /^the (.+?) page$/ # translate to named route
17
- send "#{$1.downcase.gsub(' ','_')}_path"
18
-
19
- # end added by pickle path
20
- <%= current_paths_footer %>
28
+ # Add more mappings here.
29
+ # Here is an example that pulls values out of the Regexp:
30
+ #
31
+ # when /^(.*)'s profile page$/i
32
+ # user_profile_path(User.find_by_login($1))
33
+
34
+ else
35
+ begin
36
+ page_name =~ /the (.*) page/
37
+ path_components = $1.split(/\s+/)
38
+ self.send(path_components.push('path').join('_').to_sym)
39
+ rescue Object => e
40
+ raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
41
+ "Now, go and add a mapping in #{__FILE__}"
42
+ end
43
+ end
44
+ end
45
+ end
46
+
47
+ World(NavigationHelpers)
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pickle
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 15
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 2
8
- - 11
9
- version: 0.2.11
9
+ - 12
10
+ version: 0.2.12
10
11
  platform: ruby
11
12
  authors:
12
13
  - Ian White
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-05-13 00:00:00 +01:00
18
+ date: 2010-06-23 00:00:00 +01:00
18
19
  default_executable:
19
20
  dependencies: []
20
21
 
@@ -104,23 +105,27 @@ rdoc_options:
104
105
  require_paths:
105
106
  - lib
106
107
  required_ruby_version: !ruby/object:Gem::Requirement
108
+ none: false
107
109
  requirements:
108
110
  - - ">="
109
111
  - !ruby/object:Gem::Version
112
+ hash: 3
110
113
  segments:
111
114
  - 0
112
115
  version: "0"
113
116
  required_rubygems_version: !ruby/object:Gem::Requirement
117
+ none: false
114
118
  requirements:
115
119
  - - ">="
116
120
  - !ruby/object:Gem::Version
121
+ hash: 3
117
122
  segments:
118
123
  - 0
119
124
  version: "0"
120
125
  requirements: []
121
126
 
122
127
  rubyforge_project:
123
- rubygems_version: 1.3.6
128
+ rubygems_version: 1.3.7
124
129
  signing_key:
125
130
  specification_version: 3
126
131
  summary: Easy model creation and reference in your cucumber features