update_status 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ source "http://rubygems.org"
7
7
  # Add dependencies to develop your gem here.
8
8
  # Include everything needed to run rake, tests, features, etc.
9
9
  group :development do
10
- gem "rspec", ">= 0"
10
+ gem "rspec", ">= 2.11.0"
11
11
  gem "rdoc", "~> 3.12"
12
12
  gem "bundler", ">= 1.2.1"
13
13
  gem "jeweler", "~> 1.8.4"
data/Gemfile.lock CHANGED
@@ -17,14 +17,14 @@ GEM
17
17
  json (~> 1.4)
18
18
  rest-client (1.6.7)
19
19
  mime-types (>= 1.16)
20
- rspec (2.9.0)
21
- rspec-core (~> 2.9.0)
22
- rspec-expectations (~> 2.9.0)
23
- rspec-mocks (~> 2.9.0)
24
- rspec-core (2.9.0)
25
- rspec-expectations (2.9.1)
20
+ rspec (2.11.0)
21
+ rspec-core (~> 2.11.0)
22
+ rspec-expectations (~> 2.11.0)
23
+ rspec-mocks (~> 2.11.0)
24
+ rspec-core (2.11.1)
25
+ rspec-expectations (2.11.3)
26
26
  diff-lcs (~> 1.1.3)
27
- rspec-mocks (2.9.0)
27
+ rspec-mocks (2.11.3)
28
28
 
29
29
  PLATFORMS
30
30
  ruby
@@ -36,4 +36,4 @@ DEPENDENCIES
36
36
  rcov
37
37
  rdoc (~> 3.12)
38
38
  rest-client (>= 1.6.7)
39
- rspec
39
+ rspec (>= 2.11.0)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -8,7 +8,7 @@ module Status
8
8
  end
9
9
 
10
10
  def request
11
- Status::Request.new.post(status_api, payload)
11
+ Request.new.post(status_api, payload)
12
12
  end
13
13
 
14
14
  private
@@ -22,7 +22,11 @@ module Status
22
22
  end
23
23
 
24
24
  def payload
25
- {:state => state, :description => description, :target_url => "#{Status.ci_url}#{Status.branch}"}
25
+ {:state => state, :description => description, :target_url => target_url}
26
+ end
27
+
28
+ def target_url
29
+ "#{Status.ci_url}/job/#{Status.branch}"
26
30
  end
27
31
 
28
32
  def state
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ describe Status::Github::Statuses do
4
+ before do
5
+ stub_const("Jenkins", stub)
6
+ end
7
+
8
+ subject { Status::Github::Statuses }
9
+ it "has a payload target URL of the ci server URL and the branch name" do
10
+ Status.stub(:ci_url => "http://jenkins-ci.org", :branch => "feature_branch")
11
+ subject.new.send(:target_url).should == "http://jenkins-ci.org/job/feature_branch"
12
+ end
13
+
14
+ it "has a payload description of the ci state and qa status" do
15
+ Jenkins.stub(:state => "Green")
16
+ subject.new.send(:description).should == "Build status: Green, QA pending"
17
+ end
18
+
19
+ it "has a payload pending state when ci is passing but qa hasn't passed" do
20
+ Jenkins.stub(:pass? => true)
21
+ subject.new.send(:state).should == "pending"
22
+ end
23
+
24
+ it "has a payload success state when ci is passing and qa has passed" do
25
+ Jenkins.stub(:pass? => true)
26
+ subject.new("pass").send(:state).should == "success"
27
+ end
28
+
29
+ it "goes to the correct status api" do
30
+ Status.stub(:owner => "owner", :repo => "status", :sha => "99efgd", :token => "123")
31
+ subject.new.send(:status_api).should == "/repos/owner/status/statuses/99efgd?access_token=123"
32
+ end
33
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "update_status"
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Douglas Roper"]
12
- s.date = "2012-10-25"
12
+ s.date = "2012-10-26"
13
13
  s.description = "Updates pull requests on github, with latest build from Jenkins and QA status"
14
14
  s.email = "douglasroper@notonthehighstreet.com"
15
15
  s.executables = ["status"]
@@ -35,10 +35,9 @@ Gem::Specification.new do |s|
35
35
  "lib/status/request.rb",
36
36
  "spec/spec_helper.rb",
37
37
  "spec/status/github/pull_request_spec.rb",
38
+ "spec/status/github/statuses_spec.rb",
38
39
  "spec/status/jenkins_spec.rb",
39
40
  "status.gemspec",
40
- "test/helper.rb",
41
- "test/test_status.rb",
42
41
  "update_status.gemspec"
43
42
  ]
44
43
  s.homepage = "http://github.com/dougdroper/status"
@@ -53,7 +52,7 @@ Gem::Specification.new do |s|
53
52
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
54
53
  s.add_runtime_dependency(%q<multi_json>, [">= 1.0.3"])
55
54
  s.add_runtime_dependency(%q<rest-client>, [">= 1.6.7"])
56
- s.add_development_dependency(%q<rspec>, [">= 0"])
55
+ s.add_development_dependency(%q<rspec>, [">= 2.11.0"])
57
56
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
58
57
  s.add_development_dependency(%q<bundler>, [">= 1.2.1"])
59
58
  s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
@@ -61,7 +60,7 @@ Gem::Specification.new do |s|
61
60
  else
62
61
  s.add_dependency(%q<multi_json>, [">= 1.0.3"])
63
62
  s.add_dependency(%q<rest-client>, [">= 1.6.7"])
64
- s.add_dependency(%q<rspec>, [">= 0"])
63
+ s.add_dependency(%q<rspec>, [">= 2.11.0"])
65
64
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
66
65
  s.add_dependency(%q<bundler>, [">= 1.2.1"])
67
66
  s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
@@ -70,7 +69,7 @@ Gem::Specification.new do |s|
70
69
  else
71
70
  s.add_dependency(%q<multi_json>, [">= 1.0.3"])
72
71
  s.add_dependency(%q<rest-client>, [">= 1.6.7"])
73
- s.add_dependency(%q<rspec>, [">= 0"])
72
+ s.add_dependency(%q<rspec>, [">= 2.11.0"])
74
73
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
75
74
  s.add_dependency(%q<bundler>, [">= 1.2.1"])
76
75
  s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: update_status
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Douglas Roper
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-10-25 00:00:00 Z
18
+ date: 2012-10-26 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: multi_json
@@ -56,10 +56,12 @@ dependencies:
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- hash: 3
59
+ hash: 35
60
60
  segments:
61
+ - 2
62
+ - 11
61
63
  - 0
62
- version: "0"
64
+ version: 2.11.0
63
65
  type: :development
64
66
  requirement: *id003
65
67
  prerelease: false
@@ -151,10 +153,9 @@ files:
151
153
  - lib/status/request.rb
152
154
  - spec/spec_helper.rb
153
155
  - spec/status/github/pull_request_spec.rb
156
+ - spec/status/github/statuses_spec.rb
154
157
  - spec/status/jenkins_spec.rb
155
158
  - status.gemspec
156
- - test/helper.rb
157
- - test/test_status.rb
158
159
  - update_status.gemspec
159
160
  homepage: http://github.com/dougdroper/status
160
161
  licenses:
data/test/helper.rb DELETED
@@ -1,18 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'test/unit'
11
- require 'shoulda'
12
-
13
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
- $LOAD_PATH.unshift(File.dirname(__FILE__))
15
- require 'status'
16
-
17
- class Test::Unit::TestCase
18
- end
data/test/test_status.rb DELETED
@@ -1,7 +0,0 @@
1
- require 'helper'
2
-
3
- class TestStatus < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
6
- end
7
- end