kosmas58-cucumber 0.2.0 → 0.2.0.1

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.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.2.1 (In Git)
2
+
3
+ == Bugfixes
4
+ * Snippets are showing 'Ands' (#249 Aslak Hellesøy)
5
+
1
6
  == 0.2.0 2009-03-18
2
7
 
3
8
  This release sports a bunch of new and exciting features, as well a major rewrite of Cucumber's internals.
data/Manifest.txt CHANGED
@@ -177,9 +177,11 @@ examples/tickets/features/177/3.feature
177
177
  examples/tickets/features/180.feature
178
178
  examples/tickets/features/236.feature
179
179
  examples/tickets/features/241.feature
180
+ examples/tickets/features/248.feature
180
181
  examples/tickets/features/lib/eatting_machine.rb
181
182
  examples/tickets/features/lib/pantry.rb
182
183
  examples/tickets/features/scenario_outline.feature
184
+ examples/tickets/features/step_definitons/248_steps.rb
183
185
  examples/tickets/features/step_definitons/scenario_outline_steps.rb
184
186
  examples/tickets/features/step_definitons/tickets_steps.rb
185
187
  examples/tickets/features/tickets.feature
data/gem_tasks/rspec.rake CHANGED
@@ -31,8 +31,6 @@ if require_spec
31
31
  Spec::Rake::SpecTask.new do |t|
32
32
  t.spec_opts = ['--options', "spec/spec.opts"]
33
33
  t.spec_files = FileList['spec/**/*_spec.rb']
34
- t.fail_on_error = false
35
- #t.rcov = true
36
34
  t.rcov = ENV['RCOV']
37
35
  t.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/}
38
36
  end
@@ -78,21 +78,6 @@ module Cucumber
78
78
  @file_colon_line ||= @feature_element.file_colon_line(@line) unless @feature_element.nil?
79
79
  end
80
80
 
81
- def actual_keyword
82
- if [Cucumber.keyword_hash['and'], Cucumber.keyword_hash['but']].index(@keyword) && previous_step
83
- previous_step.actual_keyword
84
- else
85
- @keyword
86
- end
87
- end
88
-
89
- protected
90
-
91
- # TODO: Remove when we use StepCollection everywhere
92
- def previous_step
93
- @feature_element.previous_step(self)
94
- end
95
-
96
81
  private
97
82
 
98
83
  def matched_cells(cells)
@@ -79,7 +79,7 @@ module Cucumber
79
79
  end
80
80
 
81
81
  def actual_keyword
82
- if [Cucumber.keyword_hash['and'], Cucumber.keyword_hash['but']].index(@keyword) && previous
82
+ if [Cucumber.keyword_hash['and'], Cucumber.keyword_hash['but']].index(@step.keyword) && previous
83
83
  previous.actual_keyword
84
84
  else
85
85
  @step.keyword
@@ -64,7 +64,7 @@ module Cucumber
64
64
  # Formats the matched arguments of the associated Step. This method
65
65
  # is usually called from visitors, which render output.
66
66
  #
67
- # The +format+ either be a String or a Proc.
67
+ # The +format+ can either be a String or a Proc.
68
68
  #
69
69
  # If it is a String it should be a format string according to
70
70
  # <tt>Kernel#sprinf</tt>, for example:
@@ -3,7 +3,7 @@ module Cucumber #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
5
  TINY = 0
6
- PATCH = nil # Set to nil for official release
6
+ PATCH = 1 # Set to nil for official release
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
9
9
  end
@@ -5,8 +5,7 @@ class CucumberGenerator < Rails::Generator::Base
5
5
  DEFAULT_SHEBANG = File.join(Config::CONFIG["bindir"],
6
6
  Config::CONFIG["ruby_install_name"])
7
7
 
8
- attr_reader :language
9
- attr_accessor :framework
8
+ attr_accessor :framework, :language
10
9
 
11
10
  def initialize(runtime_args, runtime_options = {})
12
11
  super
@@ -19,16 +18,16 @@ class CucumberGenerator < Rails::Generator::Base
19
18
  set_language(@language)
20
19
  end
21
20
  record do |m|
22
- m.directory File.join(@features_path, "step_definitions")
21
+ m.directory "features/support"
22
+ m.file "env.rb", "features/support/env.rb"
23
+ m.directory File.join(@features_path, "step_definitions")
23
24
  if @language
24
25
  m.file File.join(@language, "webrat_steps.rb"), File.join(@features_path, "step_definitions", "paths.rb")
25
26
  m.file File.join(@language, "webrat_steps.rb"), File.join(@features_path, "step_definitions", "webrat_steps.rb")
26
27
  else
27
28
  m.file "webrat_steps.rb", File.join(@features_path, "step_definitions", "webrat_steps.rb")
28
29
  m.file "paths.rb", "features/support/paths.rb"
29
- end
30
- m.directory "features/support"
31
- m.file "env.rb", "features/support/env.rb"
30
+ end
32
31
 
33
32
  m.directory "lib/tasks"
34
33
  m.template "cucumber.rake", "lib/tasks/cucumber.rake"
@@ -48,13 +47,7 @@ protected
48
47
  def banner
49
48
  "Usage: #{$0} cucumber"
50
49
  end
51
-
52
- def add_options!(opt)
53
- opt.separator ""
54
- opt.separator "Options:"
55
- opt.on("-l", "--language=lang", String, "Use a [language] subdirectoy in /features.") { |v| options[:language] = v }
56
- end
57
-
50
+
58
51
  # Load up the transations for the passed language, and modify the features_path accordingly
59
52
  def set_language(language)
60
53
  @features_path = File.join(@features_path, language)
@@ -70,6 +63,11 @@ protected
70
63
  opt.on('--testunit', 'Setup cucumber for use with test/unit') do |value|
71
64
  options[:framework] = :testunit
72
65
  end
66
+
67
+ opt.on("-l", "--language=lang", String, "Use a [language] subdirectoy in /features.") do |value|
68
+ options[:language] = value
69
+ end
70
+
73
71
  end
74
72
 
75
73
  end
@@ -3,6 +3,14 @@ require File.dirname(__FILE__) + '/../../spec_helper'
3
3
  module Cucumber
4
4
  module Ast
5
5
  describe StepCollection do
6
+ it "should convert And to Given in snippets" do
7
+ c = StepCollection.new([
8
+ Step.new(1, 'Given', 'cukes'),
9
+ Step.new(2, 'And', 'turnips')
10
+ ])
11
+ actual_keywords = c.step_invocations.map{|i| i.actual_keyword}
12
+ actual_keywords.should == %w{Given Given}
13
+ end
6
14
  end
7
15
  end
8
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kosmas58-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Aslak Helles\xC3\xB8y"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-18 00:00:00 -07:00
12
+ date: 2009-03-20 00:00:00 -07:00
13
13
  default_executable: cucumber
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency