limited_red 0.3.10 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
File without changes
@@ -11,6 +11,14 @@ module LimitedRed
11
11
  @thread_pool = thread_pool
12
12
  end
13
13
 
14
+ def log_fail_result(build_id, data)
15
+ log_result(build_id, data.merge(:pass => 'false'))
16
+ end
17
+
18
+ def log_pass_result(build_id, data)
19
+ log_result(build_id, data.merge(:pass => 'true'))
20
+ end
21
+
14
22
  def log_result(build_id, data)
15
23
  data[:result] = @adapter.encode_and_compress(data[:result])
16
24
  data = data.merge({:user => @username,
@@ -19,6 +27,7 @@ module LimitedRed
19
27
 
20
28
  #@thread_pool.with_a_thread_run do
21
29
  response = @adapter.post("/projects/#{@project_id}/builds/#{build_id}/results", :body => data)
30
+ p response
22
31
  log(response) if error?(response)
23
32
  #end
24
33
  end
@@ -56,6 +65,7 @@ module LimitedRed
56
65
  def token_for(data)
57
66
  data_string = @username.to_s +
58
67
  @project_id.to_s +
68
+ (data[:uri] ? data[:uri] : "") +
59
69
  build_data_string(data[:fails]) +
60
70
  build_data_string(data[:passes]) +
61
71
  (data[:result] ? data[:result] : "") +
@@ -72,10 +82,8 @@ module LimitedRed
72
82
  def pass_string(pass)
73
83
  if pass.nil?
74
84
  return ""
75
- elsif pass
76
- return true.to_s
77
85
  else
78
- return false.to_s
86
+ return pass
79
87
  end
80
88
  end
81
89
 
@@ -19,7 +19,7 @@ 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)
22
+ @client.log_result(@build_id, :result => json, :uri => feature_hash['uri'])
23
23
  else
24
24
  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
25
  end
@@ -15,23 +15,28 @@ RSpec.configure do |config|
15
15
 
16
16
  metadata.add_exception(example.exception)
17
17
 
18
- FakeWeb.allow_net_connect = true if defined?(FakeWeb)
19
- CLIENT.log_result(BUILD_ID, :result => metadata.to_json)
20
- #CLIENT.log_result(BUILD_ID, :result => metadata.to_json, :pass => false)
21
- FakeWeb.allow_net_connect = false if defined?(FakeWeb)
18
+ without_fakeweb do
19
+ CLIENT.log_fail_result(BUILD_ID, :uri => metadata.uri, :result => metadata.to_json)
20
+ end
22
21
  else # Pass
23
22
  passes << metadata.file_and_line
24
- FakeWeb.allow_net_connect = true
25
- CLIENT.log_result(BUILD_ID, :result => metadata.to_json)
26
- #CLIENT.log_result(BUILD_ID, :result => metadata.to_json, :pass => true)
27
- FakeWeb.allow_net_connect = false
23
+ without_fakeweb do
24
+ CLIENT.log_pass_result(BUILD_ID, :uri => metadata.uri, :result => metadata.to_json)
25
+ end
28
26
  end
29
27
  end
30
28
 
31
29
  config.after(:suite) do
30
+ without_fakeweb do
31
+ CLIENT.log_build(BUILD_ID, {:fails => fails,
32
+ :passes => passes})
33
+ end
34
+ end
35
+
36
+ def without_fakeweb
32
37
  FakeWeb.allow_net_connect = true if defined?(FakeWeb)
33
- CLIENT.log_build(BUILD_ID, {:fails => fails,
34
- :passes => passes})
38
+ yield
35
39
  FakeWeb.allow_net_connect = false if defined?(FakeWeb)
36
40
  end
41
+
37
42
  end
@@ -27,12 +27,13 @@ module LimitedRed
27
27
  def file_and_line
28
28
  "#{file}:#{line}"
29
29
  end
30
-
31
- private
30
+
32
31
  def uri
33
32
  scopes.map{|s| s.to_s.downcase.gsub(/\s+/, '-')}.join("-")
34
33
  end
35
-
34
+
35
+ private
36
+
36
37
  def full_description
37
38
  @metadata[:full_description]
38
39
  end
@@ -1,5 +1,5 @@
1
1
  module LimitedRed # :nodoc:
2
2
  module Version # :nodoc:
3
- STRING = '0.3.10'
3
+ STRING = '0.3.11'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: limited_red
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 3
9
- - 10
10
- version: 0.3.10
8
+ - 11
9
+ version: 0.3.11
11
10
  platform: ruby
12
11
  authors:
13
12
  - Joseph Wilk
@@ -15,17 +14,16 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2012-03-28 00:00:00 Z
17
+ date: 2012-04-12 00:00:00 +01:00
18
+ default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: httparty
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
24
  requirements:
26
25
  - - "="
27
26
  - !ruby/object:Gem::Version
28
- hash: 61
29
27
  segments:
30
28
  - 0
31
29
  - 8
@@ -37,11 +35,9 @@ dependencies:
37
35
  name: cucumber
38
36
  prerelease: false
39
37
  requirement: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
38
  requirements:
42
39
  - - ">="
43
40
  - !ruby/object:Gem::Version
44
- hash: 27
45
41
  segments:
46
42
  - 1
47
43
  - 1
@@ -57,7 +53,7 @@ extensions: []
57
53
 
58
54
  extra_rdoc_files:
59
55
  - LICENSE
60
- - Readme.md
56
+ - README.md
61
57
  files:
62
58
  - lib/limited_red/adapter/httparty.rb
63
59
  - lib/limited_red/client.rb
@@ -72,7 +68,8 @@ files:
72
68
  - lib/limited_red/version.rb
73
69
  - lib/limited_red.rb
74
70
  - LICENSE
75
- - Readme.md
71
+ - README.md
72
+ has_rdoc: true
76
73
  homepage: http://www.limited-red.com
77
74
  licenses:
78
75
  - MIT
@@ -82,27 +79,23 @@ rdoc_options:
82
79
  require_paths:
83
80
  - lib
84
81
  required_ruby_version: !ruby/object:Gem::Requirement
85
- none: false
86
82
  requirements:
87
83
  - - ">="
88
84
  - !ruby/object:Gem::Version
89
- hash: 3
90
85
  segments:
91
86
  - 0
92
87
  version: "0"
93
88
  required_rubygems_version: !ruby/object:Gem::Requirement
94
- none: false
95
89
  requirements:
96
90
  - - ">="
97
91
  - !ruby/object:Gem::Version
98
- hash: 3
99
92
  segments:
100
93
  - 0
101
94
  version: "0"
102
95
  requirements: []
103
96
 
104
97
  rubyforge_project:
105
- rubygems_version: 1.8.21
98
+ rubygems_version: 1.3.6
106
99
  signing_key:
107
100
  specification_version: 3
108
101
  summary: Client for www.limited-red.com service