aslakhellesoy-cucumber 0.3.11.1 → 0.3.11.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ require 'spec/expectations'
4
4
  require 'fileutils'
5
5
  require 'forwardable'
6
6
  begin
7
- require 'spork'
7
+ gem "spork", ">= 0.5.1" # Ensure correct spork version number to avoid false-negatives.
8
8
  rescue Gem::LoadError => ex
9
9
  warn "WARNING: #{ex.message} You need to have the spork gem installed to run the DRb feature properly!"
10
10
  end
@@ -0,0 +1,4 @@
1
+ desc 'Generate the css for the html formatter from sass'
2
+ task :sass do
3
+ sh 'sass -t expanded lib/cucumber/formatter/cucumber.sass > lib/cucumber/formatter/cucumber.css'
4
+ end
@@ -3,18 +3,17 @@ require "drb/drb"
3
3
 
4
4
  module Cucumber
5
5
  module Cli
6
+ class DRbClientError < StandardError
7
+ end
6
8
  # Runs features on a DRB server, originally created with Spork compatibility in mind.
7
9
  class DRbClient
8
10
  def self.run(args, error_stream, out_stream)
9
- begin
10
- # See http://redmine.ruby-lang.org/issues/show/496 as to why we specify localhost:0
11
- DRb.start_service("druby://localhost:0")
12
- feature_server = DRbObject.new_with_uri("druby://127.0.0.1:8990")
13
- feature_server.run(args, error_stream, out_stream)
14
- true
15
- rescue DRb::DRbConnError
16
- false
17
- end
11
+ # See http://redmine.ruby-lang.org/issues/show/496 as to why we specify localhost:0
12
+ DRb.start_service("druby://localhost:0")
13
+ feature_server = DRbObject.new_with_uri("druby://127.0.0.1:8990")
14
+ feature_server.run(args, error_stream, out_stream)
15
+ rescue DRb::DRbConnError
16
+ raise DRbClientError, "No DRb server is running."
18
17
  end
19
18
  end
20
19
  end
@@ -34,10 +34,10 @@ module Cucumber
34
34
 
35
35
  def execute!(step_mother)
36
36
  if configuration.drb?
37
- if DRbClient.run(@args, @error_stream, @out_stream)
38
- return false
39
- else
40
- @error_stream.puts "WARNING: No DRb server is running. Running features locally:"
37
+ begin
38
+ return DRbClient.run(@args, @error_stream, @out_stream)
39
+ rescue DRbClientError => e
40
+ @error_stream.puts "WARNING: #{e.message} Running features locally:"
41
41
  configuration.parse!(@args)
42
42
  end
43
43
  end
@@ -1,74 +1,127 @@
1
+
2
+
1
3
  .cucumber {
2
- background: black;
3
- color: white;
4
+ font-family: "Lucida Grande", Helvetica, sans-serif;
5
+ font-size: 0.7em;
6
+ background: white;
4
7
  padding: 1em;
5
8
  }
6
- .cucumber .passed {
7
- color: #008800;
9
+ .cucumber .stats {
10
+ margin: 2em;
8
11
  }
9
- .cucumber .undefined {
10
- color: #888800;
12
+ .cucumber .summary ul.features li {
13
+ display: inline;
11
14
  }
12
- .cucumber .pending {
13
- color: #888800;
15
+ .cucumber .backtrace {
16
+ margin-top: 0;
17
+ margin-bottom: 0;
18
+ margin-left: 1em;
14
19
  }
15
- .cucumber .failed {
16
- color: #880000;
20
+ .cucumber a {
21
+ text-decoration: none;
22
+ color: inherit;
17
23
  }
18
- .cucumber .skipped {
19
- color: #008888;
24
+ .cucumber a:hover {
25
+ text-decoration: underline;
20
26
  }
21
- .cucumber .outline {
22
- color: #008888;
27
+ .cucumber a:visited {
28
+ font-weight: normal;
23
29
  }
24
-
25
- .cucumber .passed_param {
26
- font-weight: bold;
27
- color: #00ff00;
30
+ .cucumber div.background, .cucumber div.scenario {
31
+ border: 1px solid;
32
+ padding: 2px;
33
+ margin: 4px;
28
34
  }
29
- .cucumber .undefined_param {
30
- font-weight: bold;
31
- color: #ffff00;
35
+ .cucumber div.background h3, .cucumber div.background h4, .cucumber div.scenario h3, .cucumber div.scenario h4 {
36
+ padding: 0px;
37
+ margin: 0px;
32
38
  }
33
- .cucumber .pending_param {
34
- font-weight: bold;
35
- color: #ffff00;
39
+ .cucumber div.background div.examples, .cucumber div.scenario div.examples {
40
+ border: 1px solid;
41
+ padding: 2px;
42
+ margin: 4px;
36
43
  }
37
- .cucumber .failed_param {
38
- font-weight: bold;
39
- font-weight: bold;
40
- color: #ff0000;
44
+ .cucumber table {
45
+ border-collapse: collapse;
41
46
  }
42
- .cucumber .skipped_param {
43
- font-weight: bold;
44
- color: #00ffff;
47
+ .cucumber table td, .cucumber table th {
48
+ font-size: 0.7em;
49
+ border: 1px solid #AAAAAA;
45
50
  }
46
- .cucumber .outline_param {
47
- font-weight: bold;
48
- color: #00ffff;
51
+ .cucumber table td.failed {
52
+ background: #FFC0CB;
53
+ color: #8B0000;
49
54
  }
50
-
51
- .cucumber a {
52
- text-decoration: none;
53
- color: inherit;
55
+ .cucumber table td.passed {
56
+ background: #98FB98;
57
+ color: #001111;
54
58
  }
55
- .cucumber a:hover {
56
- text-decoration: underline;
59
+ .cucumber table td.skipped {
60
+ background: #e0ffff;
61
+ color: #001111;
57
62
  }
58
- .cucumber a:visited {
59
- font-weight: normal;
63
+ .cucumber table td.pending {
64
+ background: #FFFFE0;
65
+ color: #111100;
66
+ }
67
+ .cucumber table td.undefined {
68
+ background: #FFFFE0;
69
+ color: #111100;
60
70
  }
61
71
  .cucumber ol {
62
72
  list-style: none;
73
+ margin-left: 0;
74
+ padding-left: 0;
63
75
  }
64
- .cucumber .stats {
65
- margin: 2em;
76
+ .cucumber ol li {
77
+ margin: 5px 0 5px 5px;
78
+ padding: 0.3em;
66
79
  }
67
- .cucumber .summary ul.features li {
68
- display: inline;
80
+ .cucumber ol li span.param {
81
+ font-weight: bold;
69
82
  }
70
- .cucumber .backtrace {
71
- margin-top: 0;
72
- margin-bottom: 0;
73
- margin-left: 1em;
83
+ .cucumber ol li.failed {
84
+ border-left: 5px solid #ff0000;
85
+ border-bottom: 1px solid #ff0000;
86
+ background: #ffc0cb;
87
+ color: #8b0000;
88
+ }
89
+ .cucumber ol li.failed span.param {
90
+ background: !failed_dark;
91
+ }
92
+ .cucumber ol li.passed {
93
+ border-left: 5px solid #00ff00;
94
+ border-bottom: 1px solid #00ff00;
95
+ background: #98fb98;
96
+ color: #001111;
97
+ }
98
+ .cucumber ol li.passed span.param {
99
+ background: #00ff00;
100
+ }
101
+ .cucumber ol li.skipped {
102
+ border-left: 5px solid #00ffff;
103
+ border-bottom: 1px solid #00ffff;
104
+ background: #e0ffff;
105
+ color: #001111;
106
+ }
107
+ .cucumber ol li.skipped span.param {
108
+ background: #00ffff;
109
+ }
110
+ .cucumber ol li.pending {
111
+ border-left: 5px solid #ff8000;
112
+ border-bottom: 1px solid #ff8000;
113
+ background: #ffff00;
114
+ color: #2a1b0a;
115
+ }
116
+ .cucumber ol li.pending span.param {
117
+ background: #ff8000;
118
+ }
119
+ .cucumber ol li.undefined {
120
+ border-left: 5px solid #ff8000;
121
+ border-bottom: 1px solid #ff8000;
122
+ background: #ffff00;
123
+ color: #2a1b0a;
124
+ }
125
+ .cucumber ol li.undefined span.param {
126
+ background: #ff8000;
74
127
  }
@@ -1,39 +1,34 @@
1
1
  # cucumber.css is generated from cucumber.sass
2
- # Regenerate with the following command:
3
- #
4
- # sass -t expanded lib/cucumber/formatter/cucumber.sass > lib/cucumber/formatter/cucumber.css
5
- #
6
- .cucumber
7
- :background black
8
- :color white
9
- :padding 1em
2
+ # Regenerate with rake sass
10
3
 
11
- .passed
12
- :color green
13
- .undefined
14
- :color yellow
15
- .pending
16
- :color yellow
17
- .failed
18
- :color red
19
- .skipped
20
- :color cyan
21
- .outline
22
- :color cyan
23
- .param
24
- :font-weight bold
4
+ !step_left = 5px solid
5
+ !step_bottom = 1px solid
25
6
 
26
- a
27
- :text-decoration none
28
- :color inherit
7
+ !failed = #FFC0CB
8
+ !failed_dark = #FF0000
9
+ !failed_text = #8B0000
29
10
 
30
- &:hover
31
- :text-decoration underline
32
- &:visited
33
- :font-weight normal
11
+ !passed = #98FB98
12
+ !passed_dark = #00FF00
13
+ !passed_text = #001111
34
14
 
35
- ol
36
- :list-style none
15
+ !skipped = #E0FFFF
16
+ !skipped_dark = #00FFFF
17
+ !skipped_text = #001111
18
+
19
+ !pending = #FFFF00
20
+ !pending_dark = #FF8000
21
+ !pending_text = #2A1B0A
22
+
23
+ !undefined = #FFFF00
24
+ !undefined_dark = #FF8000
25
+ !undefined_text = #2A1B0A
26
+
27
+ .cucumber
28
+ :font-family "Lucida Grande", Helvetica, sans-serif
29
+ :font-size 0.7em
30
+ :background white
31
+ :padding 1em
37
32
 
38
33
  .stats
39
34
  :margin 2em
@@ -47,3 +42,93 @@
47
42
  :margin-top 0
48
43
  :margin-bottom 0
49
44
  :margin-left 1em
45
+
46
+ a
47
+ :text-decoration none
48
+ :color inherit
49
+
50
+ &:hover
51
+ :text-decoration underline
52
+ &:visited
53
+ :font-weight normal
54
+
55
+ div.background, div.scenario
56
+ :border 1px solid
57
+ :padding 2px
58
+ :margin 4px
59
+
60
+ h3, h4
61
+ :padding 0px
62
+ :margin 0px
63
+ div.examples
64
+ :border 1px solid
65
+ :padding 2px
66
+ :margin 4px
67
+
68
+ table
69
+ :border-collapse collapse
70
+
71
+ td, th
72
+ :font-size 0.7em
73
+ :border 1px solid #AAAAAA
74
+ td.failed
75
+ :background #FFC0CB
76
+ :color #8B0000
77
+ td.passed
78
+ :background #98FB98
79
+ :color= !passed_text
80
+ td.skipped
81
+ :background= !skipped
82
+ :color= !skipped_text
83
+ td.pending
84
+ :background #FFFFE0
85
+ :color #111100
86
+ td.undefined
87
+ :background #FFFFE0
88
+ :color #111100
89
+
90
+ ol
91
+ :list-style none
92
+ :margin-left 0
93
+ :padding-left 0
94
+
95
+ li
96
+ :margin 5px 0 5px 5px
97
+ :padding 0.3em
98
+ span.param
99
+ :font-weight bold
100
+ li.failed
101
+ :border-left= !step_left !failed_dark
102
+ :border-bottom= !step_bottom !failed_dark
103
+ :background= !failed
104
+ :color= !failed_text
105
+ span.param
106
+ :background !failed_dark
107
+ li.passed
108
+ :border-left= !step_left !passed_dark
109
+ :border-bottom= !step_bottom !passed_dark
110
+ :background= !passed
111
+ :color= !passed_text
112
+ span.param
113
+ :background= !passed_dark
114
+ li.skipped
115
+ :border-left= !step_left !skipped_dark
116
+ :border-bottom= !step_bottom !skipped_dark
117
+ :background= !skipped
118
+ :color= !skipped_text
119
+ span.param
120
+ :background= !skipped_dark
121
+ li.pending
122
+ :border-left= !step_left !pending_dark
123
+ :border-bottom= !step_bottom !pending_dark
124
+ :background= !pending
125
+ :color= !pending_text
126
+ span.param
127
+ :background= !pending_dark
128
+ li.undefined
129
+ :border-left= !step_left !undefined_dark
130
+ :border-bottom= !step_bottom !undefined_dark
131
+ :background= !undefined
132
+ :color= !undefined_text
133
+ span.param
134
+ :background= !undefined_dark
@@ -20,7 +20,7 @@ module Cucumber
20
20
  end
21
21
 
22
22
  def create_builder(io)
23
- Builder::XmlMarkup.new(:target => io, :indent => 2)
23
+ Builder::XmlMarkup.new(:target => io, :indent => 0)
24
24
  end
25
25
 
26
26
  def visit_features(features)
@@ -3,7 +3,7 @@ module Cucumber #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
5
  TINY = 11
6
- PATCH = 1 # Set to nil for official release
6
+ PATCH = 3 # Set to nil for official release
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PATCH].compact.join('.')
9
9
  end
@@ -3,7 +3,7 @@ require 'spork'
3
3
 
4
4
  Spork.prefork do
5
5
  # Sets up the Rails environment for Cucumber
6
- ENV["RAILS_ENV"] ||= "cucumber"
6
+ ENV["RAILS_ENV"] = "cucumber"
7
7
  require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
8
8
 
9
9
  require 'webrat'
@@ -28,13 +28,14 @@ module Cucumber
28
28
  DRbClient.run(@args, @error_stream, @out_stream)
29
29
  end
30
30
 
31
- it "returns false when it can't connect to the server" do
31
+ it "returns raises an error when it can't connect to the server" do
32
32
  DRbObject.stub!(:new_with_uri).and_raise(DRb::DRbConnError)
33
- DRbClient.run(@args, @error_stream, @out_stream).should be_false
33
+ running { DRbClient.run(@args, @error_stream, @out_stream) }.should raise_error(DRbClientError, "No DRb server is running.")
34
34
  end
35
35
 
36
- it "returns true when it connects to the server and runs the features" do
37
- DRbClient.run(@args, @error_stream, @out_stream).should be_true
36
+ it "returns the result from the DRb server call" do
37
+ @drb_object.should_receive(:run).and_return('foo')
38
+ DRbClient.run(@args, @error_stream, @out_stream).should == 'foo'
38
39
  end
39
40
 
40
41
  end
@@ -110,6 +110,12 @@ module Cucumber
110
110
  @cli.execute!(@step_mother)
111
111
  end
112
112
 
113
+ it "returns the result from the DRbClient" do
114
+ DRbClient.stub!(:run).and_return('foo')
115
+ @cli.execute!(@step_mother).should == 'foo'
116
+ end
117
+
118
+
113
119
  it "ceases execution if the DrbClient is able to perform the execution" do
114
120
  DRbClient.stub!(:run).and_return(true)
115
121
  @configuration.should_not_receive(:load_language)
@@ -117,11 +123,11 @@ module Cucumber
117
123
  end
118
124
 
119
125
  context "when the DrbClient is unable to perfrom the execution" do
120
- before { DRbClient.stub!(:run).and_return(false) }
126
+ before { DRbClient.stub!(:run).and_raise(DRbClientError.new('error message.')) }
121
127
 
122
128
  it "alerts the user that execution will be performed locally" do
123
129
  @cli.execute!(@step_mother)
124
- @err.string.should include("WARNING: No DRb server is running. Running features locally:")
130
+ @err.string.should include("WARNING: error message. Running features locally:")
125
131
  end
126
132
 
127
133
  it "reparses the configuration since the --drb flag causes the initial parsing to short circuit" do
data/spec/spec_helper.rb CHANGED
@@ -10,3 +10,5 @@ Cucumber.load_language('en')
10
10
  $:.unshift(File.dirname(__FILE__))
11
11
 
12
12
  ::Term::ANSIColor.coloring = true
13
+
14
+ alias running lambda
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.3.11.1
4
+ version: 0.3.11.3
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-06-05 00:00:00 -07:00
12
+ date: 2009-06-07 00:00:00 -07:00
13
13
  default_executable: cucumber
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -349,6 +349,7 @@ files:
349
349
  - gem_tasks/flog.rake
350
350
  - gem_tasks/gemspec.rake
351
351
  - gem_tasks/rspec.rake
352
+ - gem_tasks/sass.rake
352
353
  - gem_tasks/yard.rake
353
354
  - lib/autotest/cucumber.rb
354
355
  - lib/autotest/cucumber_mixin.rb
@@ -450,11 +451,6 @@ files:
450
451
  - spec/cucumber/formatter/ansicolor_spec.rb
451
452
  - spec/cucumber/formatter/color_io_spec.rb
452
453
  - spec/cucumber/formatter/duration_spec.rb
453
- - spec/cucumber/formatter/html/cucumber.css
454
- - spec/cucumber/formatter/html/cucumber.js
455
- - spec/cucumber/formatter/html/index.html
456
- - spec/cucumber/formatter/html/jquery-1.3.min.js
457
- - spec/cucumber/formatter/html/jquery.uitableedit.js
458
454
  - spec/cucumber/formatter/progress_spec.rb
459
455
  - spec/cucumber/parser/feature_parser_spec.rb
460
456
  - spec/cucumber/parser/table_parser_spec.rb
@@ -480,7 +476,7 @@ files:
480
476
  - spec/cucumber/world/pending_spec.rb
481
477
  - spec/spec.opts
482
478
  - spec/spec_helper.rb
483
- has_rdoc: true
479
+ has_rdoc: false
484
480
  homepage: http://cukes.info
485
481
  post_install_message:
486
482
  rdoc_options:
@@ -505,7 +501,7 @@ requirements: []
505
501
  rubyforge_project: rspec
506
502
  rubygems_version: 1.2.0
507
503
  signing_key:
508
- specification_version: 2
504
+ specification_version: 3
509
505
  summary: Executable Feature scenarios
510
506
  test_files: []
511
507
 
@@ -1,37 +0,0 @@
1
- body {
2
- background: #000000;
3
- color: #FFFFFF;
4
- }
5
-
6
- table {
7
- border-collapse: collapse;
8
- border-spacing: 10px;
9
- }
10
-
11
- td
12
- {
13
- border-color: #FFFFFF;
14
- border-width: 0 0.15em 0 0.15em;
15
- border-style: solid;
16
- padding: 0 0.5em 0 0.5em;
17
- }
18
-
19
- .multiline_table {
20
- padding-left: 4em;
21
- }
22
-
23
- .missing {
24
- color: yellow;
25
- }
26
-
27
- .pending {
28
- color: yellow;
29
- }
30
-
31
- .passed {
32
- color: green;
33
- }
34
-
35
- .failed {
36
- color: red;
37
- }
@@ -1,13 +0,0 @@
1
- jQuery.fn.status = function(s) {
2
- this.removeClass('idle').addClass(s);
3
- this.next('span.multiline').addClass(s);
4
- this.parent().addClass(s);
5
- this.parent().parent().children('span.feature').addClass(s);
6
- }
7
-
8
- jQuery.fn.failed = function(message, backtrace) {
9
- this.status('failed');
10
- var indentedMessage = message.replace(/^/gm, ' ');
11
- var indentedBacktrace = backtrace.replace(/^/gm, ' ');
12
- this.append("\n<span>" + indentedMessage + "</span>").append("\n<span>" + indentedBacktrace + "</span>");
13
- }
@@ -1,45 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
-
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
- <head>
6
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
- <title>Cucumber results</title>
8
- <link rel="stylesheet" href="cucumber.css" type="text/css" charset="utf-8" />
9
- <script type="text/javascript" src="jquery-1.3.min.js"></script>
10
- <script type="text/javascript" src="jquery.uitableedit.js"></script>
11
- <script type="text/javascript" src="cucumber.js"></script>
12
- </head>
13
-
14
- <body>
15
- <pre>
16
- <span><span class="feature">Feature: Sample</span>
17
-
18
- <span class="scenario"> Scenario: Missing
19
- <span id="step_1"> Given missing</span></span>
20
-
21
- <span class="scenario"> Scenario: Passing
22
- <span id="step_2"> Given passing</span><div class="multiline_table"><table>
23
- <tr>
24
- <td class="passed">1</td>
25
- <td class="passed">22</td>
26
- </tr>
27
- <tr>
28
- <td class="failed">4444</td>
29
- <td class="failed">333</td>
30
- </tr>
31
- </table></div></span>
32
- <span class="scenario"> Scenario: Failing
33
- <span id="step_3"> Given failing</span>
34
- <span class="multiline"> """
35
- Aslak
36
- Hellesøy
37
- """</span></span></span>
38
- </pre>
39
-
40
- <script type="text/javascript">$('#step_1').failed('error message', "line1\nline2\nline3")</script>
41
- <script type="text/javascript">$('#step_2').status('pending')</script>
42
- <script type="text/javascript">$('#step_3').status('passed')</script>
43
-
44
- </body>
45
- </html>