limited_red 0.4.6 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,8 +26,10 @@ module LimitedRed
26
26
  :token => token_for(data.merge(:build_id => build_id))})
27
27
 
28
28
  @thread_pool.with_a_thread_run do
29
- response = @adapter.post("/#{@project_id}/builds/#{build_id}/results", :body => data)
30
- log(response) if error?(response)
29
+ without_fakeweb do
30
+ response = @adapter.post("/#{@project_id}/builds/#{build_id}/results", :body => data)
31
+ log(response) if error?(response)
32
+ end
31
33
  end
32
34
  end
33
35
 
@@ -38,8 +40,10 @@ module LimitedRed
38
40
  :build_id => build_id, :token => token_for(data)})
39
41
 
40
42
  @thread_pool.with_a_thread_run do
41
- response = @adapter.post("/#{@project_id}/builds", :body => data)
42
- log(response) if response && error?(response)
43
+ without_fakeweb do
44
+ response = @adapter.post("/#{@project_id}/builds", :body => data)
45
+ log(response) if response && error?(response)
46
+ end
43
47
  end
44
48
  end
45
49
 
@@ -47,7 +51,10 @@ module LimitedRed
47
51
  raise "No project name was found in params: #{@config.inspect}" if @project_id.nil?
48
52
 
49
53
  begin
50
- response = @adapter.get("/#{@project_id}/features/fails")
54
+ response = nil
55
+ without_fakeweb do
56
+ response = @adapter.get("/#{@project_id}/features/fails")
57
+ end
51
58
  rescue
52
59
  puts "[Limited Red] Unable to reach www.limited-red.com. No tests will be recorded."
53
60
  return []
@@ -101,5 +108,12 @@ module LimitedRed
101
108
  def error_message(response)
102
109
  "\nLimited Red had a problem logging your test results: #{response ? response.body : ''}"
103
110
  end
111
+
112
+ def without_fakeweb
113
+ FakeWeb.allow_net_connect = true if defined?(FakeWeb)
114
+ yield
115
+ FakeWeb.allow_net_connect = false if defined?(FakeWeb)
116
+ end
117
+
104
118
  end
105
119
  end
@@ -19,7 +19,10 @@ module LimitedRed
19
19
  def after_feature(feature)
20
20
  if supports_feature_hash?
21
21
  json = feature_hash.to_json
22
- @client.log_result(@build_id, :result => json, :uri => feature_hash['uri'])
22
+
23
+ without_fakeweb do
24
+ @client.log_result(@build_id, :result => json, :uri => feature_hash['uri'])
25
+ end
23
26
  else
24
27
  puts "[limited_red]:Error: Having trouble working with your Gherkin version. Is it upto date? Report this to joe@josephwilk.net, its his fault.", ""
25
28
  end
@@ -30,8 +33,10 @@ module LimitedRed
30
33
  end
31
34
 
32
35
  def print_summary
36
+ without_fakeweb do
33
37
  @client.log_build(@build_id, {:fails => failing_files,
34
38
  :passes => passing_files})
39
+ end
35
40
 
36
41
  ThreadPool.wait_for_all_threads_to_finish
37
42
  end
@@ -59,6 +64,12 @@ module LimitedRed
59
64
  def gherkin_formatter
60
65
  @gf
61
66
  end
67
+
68
+ def without_fakeweb
69
+ FakeWeb.allow_net_connect = true if defined?(FakeWeb)
70
+ yield
71
+ FakeWeb.allow_net_connect = false if defined?(FakeWeb)
72
+ end
62
73
 
63
74
  end
64
75
  end
@@ -21,24 +21,15 @@ RSpec.configure do |config|
21
21
  end
22
22
  else # Pass
23
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
24
+ CLIENT.log_pass_result(BUILD_ID, :uri => metadata.uri, :result => metadata.to_json)
27
25
  end
28
26
  end
29
27
 
30
28
  config.after(:suite) do
31
- without_fakeweb do
32
- CLIENT.log_build(BUILD_ID, {:fails => fails,
33
- :passes => passes})
34
- end
35
- end
36
-
37
- def without_fakeweb
38
- FakeWeb.allow_net_connect = true if defined?(FakeWeb)
39
- yield
40
- FakeWeb.allow_net_connect = false if defined?(FakeWeb)
29
+ CLIENT.log_build(BUILD_ID, {:fails => fails,
30
+ :passes => passes})
41
31
  end
32
+
42
33
  end
43
34
  end
44
35
 
@@ -1,5 +1,5 @@
1
1
  module LimitedRed # :nodoc:
2
2
  module Version # :nodoc:
3
- STRING = '0.4.6'
3
+ STRING = '0.4.7'
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.6
4
+ version: 0.4.7
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-21 00:00:00.000000000Z
12
+ date: 2012-09-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
16
- requirement: &70214823420480 !ruby/object:Gem::Requirement
16
+ requirement: &70312255803060 !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: *70214823420480
24
+ version_requirements: *70312255803060
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: cucumber
27
- requirement: &70214823419960 !ruby/object:Gem::Requirement
27
+ requirement: &70312255802540 !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: *70214823419960
35
+ version_requirements: *70312255802540
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