aslakhellesoy-cucumber 0.2.0.4 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
data/History.txt
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
== 0.2.1
|
1
|
+
== 0.2.1 2009-03-25
|
2
|
+
|
3
|
+
This release fixes a few minor bugs and adds a couple of new features.
|
2
4
|
|
3
5
|
== Bugfixes
|
6
|
+
* Fixed Cucumber, and rails controller error handling (#49 Matt Patterson)
|
4
7
|
* HTML Formatter doesn't work correctly with scenario Outlines. (#260 Aslak Hellesøy)
|
5
8
|
* After blocks are run in reverse order of registration. (#113 Aslak Hellesøy)
|
6
9
|
* Snippets are showing 'Ands' (#249 Aslak Hellesøy)
|
@@ -302,18 +302,18 @@ Defined profiles in cucumber.yml:
|
|
302
302
|
def cucumber_yml
|
303
303
|
return @cucumber_yml if @cucumber_yml
|
304
304
|
unless File.exist?('cucumber.yml')
|
305
|
-
raise(YmlLoadError,"cucumber.yml was not found. Please refer to cucumber's
|
305
|
+
raise(YmlLoadError,"cucumber.yml was not found. Please refer to cucumber's documentation on defining profiles in cucumber.yml. You must define a 'default' profile to use the cucumber command without any arguments.\nType 'cucumber --help' for usage.\n")
|
306
306
|
end
|
307
307
|
|
308
308
|
require 'yaml'
|
309
309
|
begin
|
310
310
|
@cucumber_yml = YAML::load(IO.read('cucumber.yml'))
|
311
311
|
rescue Exception => e
|
312
|
-
raise(YmlLoadError,"cucumber.yml was found, but could not be parsed. Please refer to cucumber's
|
312
|
+
raise(YmlLoadError,"cucumber.yml was found, but could not be parsed. Please refer to cucumber's documentation on correct profile usage.\n")
|
313
313
|
end
|
314
314
|
|
315
315
|
if @cucumber_yml.nil? || !@cucumber_yml.is_a?(Hash)
|
316
|
-
raise(YmlLoadError,"cucumber.yml was found, but was blank or malformed. Please refer to cucumber's
|
316
|
+
raise(YmlLoadError,"cucumber.yml was found, but was blank or malformed. Please refer to cucumber's documentation on correct profile usage.\n")
|
317
317
|
end
|
318
318
|
|
319
319
|
return @cucumber_yml
|
data/lib/cucumber/rails/world.rb
CHANGED
@@ -9,18 +9,6 @@ else
|
|
9
9
|
end
|
10
10
|
require 'test/unit/testresult'
|
11
11
|
|
12
|
-
# These allow exceptions to come through as opposed to being caught and having non-helpful responses returned.
|
13
|
-
ActionController::Base.class_eval do
|
14
|
-
def rescue_action(exception)
|
15
|
-
raise exception
|
16
|
-
end
|
17
|
-
end
|
18
|
-
ActionController::Dispatcher.class_eval do
|
19
|
-
def self.failsafe_response(output, status, exception = nil)
|
20
|
-
raise exception
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
12
|
# So that Test::Unit doesn't launch at the end - makes it think it has already been run.
|
25
13
|
Test::Unit.run = true if Test::Unit.respond_to?(:run=)
|
26
14
|
|
@@ -66,6 +54,18 @@ module Cucumber #:nodoc:
|
|
66
54
|
end
|
67
55
|
end
|
68
56
|
|
57
|
+
def self.bypass_rescue
|
58
|
+
ActionController::Base.class_eval do
|
59
|
+
def rescue_action(exception)
|
60
|
+
raise exception
|
61
|
+
end
|
62
|
+
end
|
63
|
+
ActionController::Dispatcher.class_eval do
|
64
|
+
def self.failsafe_response(output, status, exception = nil)
|
65
|
+
raise exception
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
data/lib/cucumber/version.rb
CHANGED
@@ -4,6 +4,8 @@ require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
|
|
4
4
|
require 'cucumber/rails/world'
|
5
5
|
require 'cucumber/formatters/unicode' # Comment out this line if you don't want Cucumber Unicode support
|
6
6
|
Cucumber::Rails.use_transactional_fixtures
|
7
|
+
Cucumber::Rails.bypass_rescue # Comment out this line if you want Rails own error handling
|
8
|
+
# (e.g. rescue_action_in_public / rescue_responses / rescue_from)
|
7
9
|
|
8
10
|
require 'webrat'
|
9
11
|
|
@@ -113,11 +113,11 @@ END_OF_MESSAGE
|
|
113
113
|
config = Configuration.new(StringIO.new, error = StringIO.new)
|
114
114
|
config.parse!(%w{--profile i_do_not_exist})
|
115
115
|
|
116
|
-
error.string.should match(/cucumber.yml was not found. Please refer to cucumber's
|
116
|
+
error.string.should match(/cucumber.yml was not found. Please refer to cucumber's documentation on defining profiles in cucumber.yml./)
|
117
117
|
end
|
118
118
|
|
119
119
|
it "should provide a helpful error message when cucumber.yml is blank or malformed" do
|
120
|
-
expected_error_message = /cucumber.yml was found, but was blank or malformed. Please refer to cucumber's
|
120
|
+
expected_error_message = /cucumber.yml was found, but was blank or malformed. Please refer to cucumber's documentation on correct profile usage./
|
121
121
|
|
122
122
|
['', 'sfsadfs', "--- \n- an\n- array\n", "---dddfd"].each do |bad_input|
|
123
123
|
given_cucumber_yml_defined_as(bad_input)
|
@@ -130,7 +130,7 @@ END_OF_MESSAGE
|
|
130
130
|
end
|
131
131
|
|
132
132
|
it "should procide a helpful error message when the YAML can not be parsed" do
|
133
|
-
expected_error_message = /cucumber.yml was found, but could not be parsed. Please refer to cucumber's
|
133
|
+
expected_error_message = /cucumber.yml was found, but could not be parsed. Please refer to cucumber's documentation on correct profile usage./
|
134
134
|
|
135
135
|
given_cucumber_yml_defined_as("input that causes an exception in YAML loading")
|
136
136
|
YAML.should_receive(:load).and_raise Exception
|
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.2.
|
4
|
+
version: 0.2.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-
|
12
|
+
date: 2009-03-25 00:00:00 -07:00
|
13
13
|
default_executable: cucumber
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|