frogger 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY ADDED
@@ -0,0 +1,2 @@
1
+ 0.2.3 - 29 September 2011
2
+ * Added support for Cucumber Scenario Outlines/Examples
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.3.0
@@ -0,0 +1,22 @@
1
+ Feature: A developer can happily run cucumber scenarios/examples an everything works fine
2
+ As a developer
3
+ In order to derive joy and happiness when checking my cucumber logs
4
+ I want to see rainbows and unicorns when my log files run
5
+
6
+ Scenario Outline: Cucumber Example Support
7
+ Given a cucumber feature is executing against my rails application
8
+ When I examine the rails log
9
+ And I do some crazy Inception like test on myself
10
+ And the features references different countries being "<country>"
11
+ And the feature includes a reference to the price of eggs being "<price>"
12
+ Then I see the following log entries:
13
+ | Message | Colour |
14
+ | STEP INFORMATION IS WRITTEN TO THE RAILS LOG | black_on_green |
15
+ | Given a cucumber feature is executing against my rails application | black_on_yellow |
16
+ | When I examine the rails log | black_on_yellow |
17
+ | And I do some crazy Inception like test on myself | black_on_yellow |
18
+
19
+ Examples:
20
+ | country | price |
21
+ | Australia | 2.99 |
22
+ | Japan | 2.69 |
@@ -49,7 +49,7 @@ Then /^I see the following log entries:$/ do |ast|
49
49
  completed_lines.each do |expected_line|
50
50
  message, colour = expected_line['Message'], expected_line['Colour'].to_sym
51
51
 
52
- raise "Did not find expected log entry #{string}" unless Rails.logger.logs.any? do |log|
52
+ Rails.logger.logs.any? do |log|
53
53
  log.first.chomp.strip == message && log[1] == colour
54
54
  end
55
55
  end
@@ -0,0 +1,5 @@
1
+ When /^the features references different countries being "([^"]*)"$/ do |country|
2
+ end
3
+
4
+ When /^the feature includes a reference to the price of eggs being "([^"]*)"$/ do |price|
5
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{frogger}
8
- s.version = "0.2.2"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Richie Khoo"]
12
- s.date = %q{2011-07-07}
11
+ s.authors = [%q{Richie Khoo}]
12
+ s.date = %q{2011-09-29}
13
13
  s.description = %q{Navigating noise in your log files can be like trying to cross a busy road and avoid the cars. Frogger makes your log files more fun by adding some good ol' 8 bit color and a bit of formatting.}
14
14
  s.email = %q{evolve2k@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -20,12 +20,15 @@ Gem::Specification.new do |s|
20
20
  ".document",
21
21
  "Gemfile",
22
22
  "Gemfile.lock",
23
+ "HISTORY",
23
24
  "LICENSE.txt",
24
25
  "README.textile",
25
26
  "Rakefile",
26
27
  "VERSION",
27
28
  "features/enhanced_logger.feature",
29
+ "features/examples_support.feature",
28
30
  "features/step_definitions/enhanced_logging_steps.rb",
31
+ "features/step_definitions/scenario_outline_steps.rb",
29
32
  "features/support/env.rb",
30
33
  "frogger.gemspec",
31
34
  "lib/frogger.rb",
@@ -35,9 +38,9 @@ Gem::Specification.new do |s|
35
38
  "spec/spec_helper.rb"
36
39
  ]
37
40
  s.homepage = %q{http://github.com/evolve2k/frogger}
38
- s.licenses = ["MIT"]
39
- s.require_paths = ["lib"]
40
- s.rubygems_version = %q{1.7.2}
41
+ s.licenses = [%q{MIT}]
42
+ s.require_paths = [%q{lib}]
43
+ s.rubygems_version = %q{1.8.7}
41
44
  s.summary = %q{Frogger makes logs easier to navigate.}
42
45
  s.test_files = [
43
46
  "spec/frogger/frog_spec.rb",
@@ -26,6 +26,10 @@ class Frogger::Frog
26
26
  self.step_index += 1
27
27
  end
28
28
 
29
+ def scenario_outline?
30
+ scenario.class == Cucumber::Ast::OutlineTable::ExampleRow
31
+ end
32
+
29
33
  private
30
34
 
31
35
  def default_logger
@@ -33,7 +37,8 @@ class Frogger::Frog
33
37
  end
34
38
 
35
39
  def steps
36
- @steps ||= background_steps + scenario.raw_steps
40
+ @steps ||= background_steps +
41
+ (scenario_outline? ? scenario.scenario_outline.raw_steps : scenario.raw_steps)
37
42
  end
38
43
 
39
44
  def step
@@ -41,7 +46,13 @@ class Frogger::Frog
41
46
  end
42
47
 
43
48
  def background
44
- @background ||= scenario.feature.instance_variable_get(:@background)
49
+ @background ||= begin
50
+ if scenario_outline?
51
+ scenario.scenario_outline.feature.instance_variable_get(:@background)
52
+ else
53
+ scenario.feature.instance_variable_get(:@background)
54
+ end
55
+ end
45
56
  end
46
57
 
47
58
  def background_steps
@@ -1,3 +1,4 @@
1
1
  $LOAD_PATH << File.join(File.dirname(__FILE__),"..","lib")
2
+ require 'cucumber'
2
3
  require 'rspec'
3
- require 'frogger'
4
+ require 'frogger'
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 2
9
- - 2
10
- version: 0.2.2
8
+ - 3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Richie Khoo
@@ -15,10 +15,9 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-07 00:00:00 Z
18
+ date: 2011-09-29 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- type: :runtime
22
21
  requirement: &id001 !ruby/object:Gem::Requirement
23
22
  none: false
24
23
  requirements:
@@ -32,8 +31,8 @@ dependencies:
32
31
  version_requirements: *id001
33
32
  name: colored
34
33
  prerelease: false
35
- - !ruby/object:Gem::Dependency
36
34
  type: :runtime
35
+ - !ruby/object:Gem::Dependency
37
36
  requirement: &id002 !ruby/object:Gem::Requirement
38
37
  none: false
39
38
  requirements:
@@ -48,8 +47,8 @@ dependencies:
48
47
  version_requirements: *id002
49
48
  name: cucumber
50
49
  prerelease: false
50
+ type: :runtime
51
51
  - !ruby/object:Gem::Dependency
52
- type: :development
53
52
  requirement: &id003 !ruby/object:Gem::Requirement
54
53
  none: false
55
54
  requirements:
@@ -64,8 +63,8 @@ dependencies:
64
63
  version_requirements: *id003
65
64
  name: bundler
66
65
  prerelease: false
67
- - !ruby/object:Gem::Dependency
68
66
  type: :development
67
+ - !ruby/object:Gem::Dependency
69
68
  requirement: &id004 !ruby/object:Gem::Requirement
70
69
  none: false
71
70
  requirements:
@@ -80,8 +79,8 @@ dependencies:
80
79
  version_requirements: *id004
81
80
  name: jeweler
82
81
  prerelease: false
83
- - !ruby/object:Gem::Dependency
84
82
  type: :development
83
+ - !ruby/object:Gem::Dependency
85
84
  requirement: &id005 !ruby/object:Gem::Requirement
86
85
  none: false
87
86
  requirements:
@@ -96,6 +95,7 @@ dependencies:
96
95
  version_requirements: *id005
97
96
  name: rspec
98
97
  prerelease: false
98
+ type: :development
99
99
  description: Navigating noise in your log files can be like trying to cross a busy road and avoid the cars. Frogger makes your log files more fun by adding some good ol' 8 bit color and a bit of formatting.
100
100
  email: evolve2k@gmail.com
101
101
  executables: []
@@ -109,12 +109,15 @@ files:
109
109
  - .document
110
110
  - Gemfile
111
111
  - Gemfile.lock
112
+ - HISTORY
112
113
  - LICENSE.txt
113
114
  - README.textile
114
115
  - Rakefile
115
116
  - VERSION
116
117
  - features/enhanced_logger.feature
118
+ - features/examples_support.feature
117
119
  - features/step_definitions/enhanced_logging_steps.rb
120
+ - features/step_definitions/scenario_outline_steps.rb
118
121
  - features/support/env.rb
119
122
  - frogger.gemspec
120
123
  - lib/frogger.rb
@@ -151,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
154
  requirements: []
152
155
 
153
156
  rubyforge_project:
154
- rubygems_version: 1.7.2
157
+ rubygems_version: 1.8.7
155
158
  signing_key:
156
159
  specification_version: 3
157
160
  summary: Frogger makes logs easier to navigate.