aslakhellesoy-cucumber 0.1.99.20 → 0.1.99.21

Sign up to get free protection for your applications and to get access to all the features.
@@ -58,6 +58,9 @@ pure Ruby users have been enjoying for a while.
58
58
 
59
59
  == TODO Before 0.2 release
60
60
  * Make sure all features and specs pass on Windows, JRuby and Ruby 1.9
61
+ * Tighten up and simplify the grammar. More edge case features/specs.
62
+ * Reintroduce StepInvocation. Reduce some of the redundant calls to StepDefinition/StepMother. Align with JBehave.
63
+ * Make some class diagrams.
61
64
  * Implement at least a basic HTML formatter
62
65
  * Run a single cucumber feature from rake "rake features FEATURE=/path/to/feature:line"
63
66
  * Wiki page about running subsets
@@ -203,6 +203,7 @@ lib/cucumber/core_ext/proc.rb
203
203
  lib/cucumber/core_ext/string.rb
204
204
  lib/cucumber/formatter.rb
205
205
  lib/cucumber/formatter/ansicolor.rb
206
+ lib/cucumber/formatter/color_io.rb
206
207
  lib/cucumber/formatter/console.rb
207
208
  lib/cucumber/formatter/cucumber.css
208
209
  lib/cucumber/formatter/cucumber.sass
@@ -249,6 +250,7 @@ spec/cucumber/ast/scenario_outline_spec.rb
249
250
  spec/cucumber/ast/scenario_spec.rb
250
251
  spec/cucumber/ast/step_spec.rb
251
252
  spec/cucumber/ast/table_spec.rb
253
+ spec/cucumber/ast/tags_spec.rb
252
254
  spec/cucumber/broadcaster_spec.rb
253
255
  spec/cucumber/cli/configuration_spec.rb
254
256
  spec/cucumber/cli/main_spec.rb
@@ -62,7 +62,8 @@ $hoe = Hoe.new(GEM_NAME, VERS) do |p|
62
62
  ['term-ansicolor', '>= 1.0.3'],
63
63
  ['treetop', '>= 1.2.4'],
64
64
  ['polyglot', '>= 0.2.4'], # Remove this when Treetop no longer loads polyglot by default.
65
- ['diff-lcs', '>= 1.1.2']
65
+ ['diff-lcs', '>= 1.1.2'],
66
+ ['builder', '>= 2.1.2']
66
67
  ]
67
68
 
68
69
  #p.spec_extras = {} # A hash of extra values to set in the gemspec.
@@ -4,7 +4,7 @@ Feature: Cucumber command line
4
4
 
5
5
  Scenario: Run single scenario with missing step definition
6
6
  When I run cucumber -q features/sample.feature:5
7
- Then it should pass with
7
+ Then it should pass with
8
8
  """
9
9
  @one
10
10
  Feature: Sample
@@ -12,7 +12,14 @@ module Cucumber
12
12
  end
13
13
 
14
14
  def among?(tag_names)
15
- (@tag_names & tag_names).any?
15
+ no_tags, yes_tags = tag_names.partition{|tag| tag =~ /^\!/}
16
+ no_tags = no_tags.map{|tag| tag[1..-1]}
17
+
18
+ # Strip @
19
+ yes_tags = yes_tags.map{|tag| tag =~ /^@(.*)/ ? $1 : tag}
20
+ no_tags = no_tags.map{|tag| tag =~ /^@(.*)/ ? $1 : tag}
21
+
22
+ (@tag_names & yes_tags).any? && (@tag_names & no_tags).empty?
16
23
  end
17
24
 
18
25
  def at_lines?(lines)
@@ -73,7 +73,9 @@ module Cucumber
73
73
  end
74
74
  opts.on("-t TAGS", "--tags TAGS",
75
75
  "Only execute the features or scenarios with the specified tags.",
76
- "TAGS must be comma-separated without spaces.") do |v|
76
+ "TAGS must be comma-separated without spaces. Prefix tags with ! to",
77
+ "exclude features or scenarios having that tag. tags can be specified",
78
+ "with or without the @ prefix.") do |v|
77
79
  @options[:tags] = v.split(",")
78
80
  end
79
81
  opts.on("-s SCENARIO", "--scenario SCENARIO",
@@ -23,7 +23,7 @@ module Cucumber
23
23
 
24
24
  def initialize(args, out_stream = STDOUT, error_stream = STDERR)
25
25
  @args = args
26
- @out_stream = out_stream
26
+ @out_stream = out_stream == STDOUT ? Formatter::ColorIO.new : out_stream
27
27
  @error_stream = error_stream
28
28
  end
29
29
 
@@ -1 +1 @@
1
- %w{pretty progress profile rerun html}.each{|n| require "cucumber/formatter/#{n}"}
1
+ %w{color_io pretty progress profile rerun html}.each{|n| require "cucumber/formatter/#{n}"}
@@ -1,19 +1,12 @@
1
- # Hack to work around Win32/Console, which bundles a licence-violating, outdated
2
- # copy of term/ansicolor that doesn't implement Term::ANSIColor#coloring=.
3
- # We want the official one!
4
- begin
5
- gem 'term-ansicolor'
6
- rescue Exception => ignore
7
- # In order to work with Cucumber.java, which doesn't bundle gems.
8
- end
9
- $LOAD_PATH.each{|path| $LOAD_PATH.unshift($LOAD_PATH.delete(path)) if path =~ /term-ansicolor/}
1
+ gem 'term-ansicolor'
10
2
  require 'term/ansicolor'
11
3
 
12
4
  if Cucumber::WINDOWS_MRI
13
5
  begin
6
+ gem 'win32console', '>= 1.2.0'
14
7
  require 'Win32/Console/ANSI'
15
8
  rescue LoadError
16
- STDERR.puts "You must gem install win32console to get coloured output on MRI/Windows"
9
+ STDERR.puts "*** WARNING: You must gem install win32console (1.2.0 or higher) to get coloured output on MRI/Windows"
17
10
  Term::ANSIColor.coloring = false
18
11
  end
19
12
  end
@@ -0,0 +1,17 @@
1
+ require 'forwardable'
2
+
3
+ module Cucumber
4
+ module Formatter
5
+ # Adapter to make #puts/#print/#flush work with colours on Windows
6
+ class ColorIO
7
+ extend Forwardable
8
+ def_delegators :@kernel, :puts, :print # win32console colours only work when sent to Kernel
9
+ def_delegators :@stdout, :flush, :tty?
10
+
11
+ def initialize
12
+ @kernel = Kernel
13
+ @stdout = STDOUT
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,4 +1,9 @@
1
- require 'builder'
1
+ begin
2
+ require 'builder'
3
+ rescue LoadError
4
+ gem 'builder'
5
+ require 'builder'
6
+ end
2
7
 
3
8
  module Cucumber
4
9
  module Formatter
@@ -889,9 +889,9 @@ module Cucumber
889
889
  module Step1
890
890
  def build
891
891
  if multi.respond_to?(:build)
892
- Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value, multi.build)
892
+ Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value.strip, multi.build)
893
893
  else
894
- Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value)
894
+ Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value.strip)
895
895
  end
896
896
  end
897
897
  end
@@ -119,9 +119,9 @@ module Cucumber
119
119
  comment space* step_keyword space* name:line_to_eol (eol+ / eof) multi:multiline_arg? white {
120
120
  def build
121
121
  if multi.respond_to?(:build)
122
- Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value, multi.build)
122
+ Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value.strip, multi.build)
123
123
  else
124
- Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value)
124
+ Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value.strip)
125
125
  end
126
126
  end
127
127
  }
@@ -3,7 +3,7 @@ module Cucumber #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
5
  TINY = 99
6
- PATCH = 20 # Set to nil for official release
6
+ PATCH = 21 # Set to nil for official release
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
9
9
  end
@@ -0,0 +1,23 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ module Cucumber
4
+ module Ast
5
+ describe Tags do
6
+ before do
7
+ @tags = Tags.new(-1, %w{one two three})
8
+ end
9
+
10
+ it "should be among other tags" do
11
+ @tags.should be_among(%w{one})
12
+ end
13
+
14
+ it "should be among other tags even with @ prefix" do
15
+ @tags.should be_among(%w{@one})
16
+ end
17
+
18
+ it "should not be among other tags" do
19
+ @tags.should_not be_among(%w{one !two})
20
+ end
21
+ end
22
+ end
23
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aslakhellesoy-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.99.20
4
+ version: 0.1.99.21
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-02-04 00:00:00 -08:00
12
+ date: 2009-02-06 00:00:00 -08:00
13
13
  default_executable: cucumber
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -48,6 +48,15 @@ dependencies:
48
48
  - !ruby/object:Gem::Version
49
49
  version: 1.1.2
50
50
  version:
51
+ - !ruby/object:Gem::Dependency
52
+ name: builder
53
+ version_requirement:
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: 2.1.2
59
+ version:
51
60
  - !ruby/object:Gem::Dependency
52
61
  name: hoe
53
62
  version_requirement:
@@ -276,6 +285,7 @@ files:
276
285
  - lib/cucumber/core_ext/string.rb
277
286
  - lib/cucumber/formatter.rb
278
287
  - lib/cucumber/formatter/ansicolor.rb
288
+ - lib/cucumber/formatter/color_io.rb
279
289
  - lib/cucumber/formatter/console.rb
280
290
  - lib/cucumber/formatter/cucumber.css
281
291
  - lib/cucumber/formatter/cucumber.sass
@@ -322,6 +332,7 @@ files:
322
332
  - spec/cucumber/ast/scenario_spec.rb
323
333
  - spec/cucumber/ast/step_spec.rb
324
334
  - spec/cucumber/ast/table_spec.rb
335
+ - spec/cucumber/ast/tags_spec.rb
325
336
  - spec/cucumber/broadcaster_spec.rb
326
337
  - spec/cucumber/cli/configuration_spec.rb
327
338
  - spec/cucumber/cli/main_spec.rb