limited_red 0.4.3 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  AfterConfiguration do |config|
2
- unless ENV['STOP_RECORDING']
2
+ if ENV['LIMITED_RED'] || ENV['LIMITED_RED_API_KEY']
3
3
  require 'limited_red'
4
4
 
5
5
  limited_red_config = LimitedRed::Config.load_and_validate_config('cucumber')
@@ -1,42 +1,47 @@
1
1
  require 'limited_red'
2
2
 
3
3
  RSpec.configure do |config|
4
- CLIENT = LimitedRed::Client.new(LimitedRed::Config.load_and_validate_config('rspec'))
5
- BUILD_ID = Time.now.to_i
4
+ if ENV['LIMITED_RED'] || ENV['LIMITED_RED_API_KEY']
5
+ CLIENT = LimitedRed::Client.new(LimitedRed::Config.load_and_validate_config('rspec'))
6
+ BUILD_ID = Time.now.to_i
6
7
 
7
- fails = []
8
- passes = []
8
+ fails = []
9
+ passes = []
9
10
 
10
- config.after(:each) do
11
- metadata = LimitedRed::Rspec::Metadata.new(example.metadata)
11
+ config.after(:each) do
12
+ metadata = LimitedRed::Rspec::Metadata.new(example.metadata)
12
13
 
13
- if example.exception #Fail
14
- fails << metadata.file_and_line
14
+ if example.exception #Fail
15
+ fails << metadata.file_and_line
15
16
 
16
- metadata.add_exception(example.exception)
17
+ metadata.add_exception(example.exception)
17
18
 
18
- without_fakeweb do
19
- CLIENT.log_fail_result(BUILD_ID, :uri => metadata.uri, :result => metadata.to_json)
19
+ without_fakeweb do
20
+ CLIENT.log_fail_result(BUILD_ID, :uri => metadata.uri, :result => metadata.to_json)
21
+ end
22
+ else # Pass
23
+ passes << metadata.file_and_line
24
+ without_fakeweb do
25
+ CLIENT.log_pass_result(BUILD_ID, :uri => metadata.uri, :result => metadata.to_json)
26
+ end
20
27
  end
21
- else # Pass
22
- passes << metadata.file_and_line
28
+ end
29
+
30
+ config.after(:suite) do
23
31
  without_fakeweb do
24
- CLIENT.log_pass_result(BUILD_ID, :uri => metadata.uri, :result => metadata.to_json)
32
+ CLIENT.log_build(BUILD_ID, {:fails => fails,
33
+ :passes => passes})
25
34
  end
26
35
  end
27
- end
28
36
 
29
- config.after(:suite) do
30
- without_fakeweb do
31
- CLIENT.log_build(BUILD_ID, {:fails => fails,
32
- :passes => passes})
37
+ def without_fakeweb
38
+ FakeWeb.allow_net_connect = true if defined?(FakeWeb)
39
+ yield
40
+ FakeWeb.allow_net_connect = false if defined?(FakeWeb)
33
41
  end
34
42
  end
35
-
36
- def without_fakeweb
37
- FakeWeb.allow_net_connect = true if defined?(FakeWeb)
38
- yield
39
- FakeWeb.allow_net_connect = false if defined?(FakeWeb)
40
- end
41
-
42
43
  end
44
+
45
+ at_exit{
46
+ LimitedRed::ThreadPool.wait_for_all_threads_to_finish
47
+ }
@@ -1,5 +1,5 @@
1
1
  module LimitedRed # :nodoc:
2
2
  module Version # :nodoc:
3
- STRING = '0.4.3'
3
+ STRING = '0.4.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: limited_red
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-16 00:00:00.000000000Z
12
+ date: 2012-09-21 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
16
- requirement: &70239737736120 !ruby/object:Gem::Requirement
16
+ requirement: &70121349215040 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - =
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.8.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70239737736120
24
+ version_requirements: *70121349215040
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: cucumber
27
- requirement: &70239737735600 !ruby/object:Gem::Requirement
27
+ requirement: &70121349214520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 1.1.4
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70239737735600
35
+ version_requirements: *70121349214520
36
36
  description: Learn and adapt from you test metrics. Used with the www.limited-red.com
37
37
  service. Tests are priorited by the probability of failure
38
38
  email: joe@josephwilk.net