jira-ruby 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4fbda76c515f7db536eb2c983570f1bf716a980b
4
+ data.tar.gz: 92b825a2ff2337466f2b87685e6fd3cb3bc79276
5
+ SHA512:
6
+ metadata.gz: 9c2ff629f0491ec9081864cdad0dac634e06b27907caf1b71fbc434726a0b7fbf3c8f9cd373c0f8c862ddde116fd848e25e927e0d7a2d65d57b3452bafb948ca
7
+ data.tar.gz: 815c3dbfbd8bfa2946f93e1aa6239173a4d3a621382abfd3259fd4836aed6e8a62810375555a658749ac18e81299a59d3fcccced53ee1b105c94936eaa5b63f9
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ before_install:
5
+ - curl http://www.sumoheavylabs.com/rsakey.pem -o $TRAVIS_BUILD_DIR/rsakey.pem
6
+ script: bundle exec rake spec
@@ -0,0 +1,46 @@
1
+ Open Software License v. 3.0 (OSL-3.0)
2
+ This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
3
+
4
+ Licensed under the Open Software License version 3.0
5
+
6
+ 1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
7
+
8
+ a) to reproduce the Original Work in copies, either alone or as part of a collective work;
9
+
10
+ b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
11
+
12
+ c) to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License;
13
+
14
+ d) to perform the Original Work publicly; and
15
+
16
+ e) to display the Original Work publicly.
17
+
18
+ 2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
19
+
20
+ 3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
21
+
22
+ 4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
23
+
24
+ 5) External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
25
+
26
+ 6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
27
+
28
+ 7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
29
+
30
+ 8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
31
+
32
+ 9) Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
33
+
34
+ 10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
35
+
36
+ 11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
37
+
38
+ 12) Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
39
+
40
+ 13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
41
+
42
+ 14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
43
+
44
+ 15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
45
+
46
+ 16) Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
@@ -1,7 +1,8 @@
1
- = JIRA 5 API Gem
1
+ = JIRA API Gem
2
+ {<img src="https://codeclimate.com/github/sumoheavy/jira-ruby.png" />}[https://codeclimate.com/github/sumoheavy/jira-ruby]
3
+ {<img src="https://travis-ci.org/sumoheavy/jira-ruby.png?branch=master"}[https://travis-ci.org/sumoheavy/jira-ruby]
2
4
 
3
- This gem provides access to the Atlassian JIRA version 5 REST API (a.k.a REST
4
- API version 2).
5
+ This gem provides access to the Atlassian JIRA REST API.
5
6
 
6
7
  == Example usage
7
8
 
@@ -22,7 +23,7 @@ API version 2).
22
23
  == Links to JIRA REST API documentation
23
24
 
24
25
  * {Overview}[https://developer.atlassian.com/display/JIRADEV/JIRA+REST+APIs]
25
- * {Reference}[http://docs.atlassian.com/jira/REST/5.0-rc1/]
26
+ * {Reference}[http://docs.atlassian.com/jira/REST/latest/]
26
27
 
27
28
 
28
29
  == Setting up the JIRA SDK
@@ -38,7 +39,7 @@ Otherwise:
38
39
  * Unpack the dowloaded archive
39
40
  * From within the archive directory, run:
40
41
 
41
- ./bin/atlas-run-standalone --product jira --version 5.0-rc2
42
+ ./bin/atlas-run-standalone --product jira
42
43
 
43
44
  Once this is running, you should be able to connect to
44
45
  http://localhost:2990/ and login to the JIRA admin system using `admin:admin`
@@ -311,5 +312,4 @@ Here's the same example as a Sinatra application:
311
312
  session.delete(:jira_auth)
312
313
  redirect "/"
313
314
  end
314
- end
315
-
315
+ end
data/Rakefile CHANGED
@@ -1,8 +1,8 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler/gem_tasks'
2
2
 
3
3
  require 'rubygems'
4
4
  require 'rspec/core/rake_task'
5
- require 'rake/rdoctask'
5
+ require 'rdoc/task'
6
6
 
7
7
  Dir.glob('lib/tasks/*.rake').each { |r| import r }
8
8
 
@@ -10,15 +10,15 @@ task :default => [:test]
10
10
 
11
11
  task :test => [:prepare, :spec]
12
12
 
13
- describe "Prepare and run rspec tests"
13
+ desc 'Prepare and run rspec tests'
14
14
  task :prepare do
15
15
  rsa_key = File.expand_path('rsakey.pem')
16
16
  if !File.exists?(rsa_key)
17
- raise "rsakey.pem does not exist, tests will fail. Run `rake jira:generate_public_cert` first"
17
+ raise 'rsakey.pem does not exist, tests will fail. Run `rake jira:generate_public_cert` first'
18
18
  end
19
19
  end
20
20
 
21
- desc "Run RSpec tests"
21
+ desc 'Run RSpec tests'
22
22
  RSpec::Core::RakeTask.new(:spec)
23
23
 
24
24
  Rake::RDocTask.new(:doc) do |rd|
data/example.rb CHANGED
@@ -1,13 +1,17 @@
1
1
  require 'pp'
2
2
  require './lib/jira'
3
3
 
4
+ CONSUMER_KEY = 'test'
5
+ SITE = 'https://test.jira.com'
6
+
4
7
  options = {
5
- :private_key_file => "rsakey.pem"
8
+ :private_key_file => "rsakey.pem",
9
+ :context_path => '',
10
+ :consumer_key => CONSUMER_KEY,
11
+ :site => SITE
6
12
  }
7
13
 
8
- CONSUMER_KEY = 'test'
9
-
10
- client = JIRA::Client.new(CONSUMER_KEY, '', options)
14
+ client = JIRA::Client.new(options)
11
15
 
12
16
  if ARGV.length == 0
13
17
  # If not passed any command line arguments, open a browser and prompt the
@@ -5,10 +5,10 @@ require "jira/version"
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "jira-ruby"
7
7
  s.version = JIRA::VERSION
8
- s.authors = ["Trineo Ltd"]
9
- s.homepage = "http://trineo.co.nz"
10
- s.summary = %q{Ruby Gem for use with the Atlassian JIRA 5 REST API}
11
- s.description = %q{API for JIRA 5}
8
+ s.authors = ["SUMO Heavy Industries"]
9
+ s.homepage = "http://www.sumoheavy.com"
10
+ s.summary = %q{Ruby Gem for use with the Atlassian JIRA REST API}
11
+ s.description = %q{API for JIRA}
12
12
 
13
13
  s.rubyforge_project = "jira-ruby"
14
14
 
@@ -22,10 +22,10 @@ Gem::Specification.new do |s|
22
22
  # s.add_runtime_dependency "rest-client"
23
23
  s.add_runtime_dependency "oauth"
24
24
  s.add_development_dependency "oauth"
25
- s.add_runtime_dependency "railties"
26
25
  s.add_development_dependency "railties"
27
26
  s.add_runtime_dependency "activesupport"
28
27
  s.add_development_dependency "activesupport"
29
28
  s.add_development_dependency "webmock"
30
29
  s.add_development_dependency "rspec"
30
+ s.add_development_dependency "rake"
31
31
  end
@@ -1,3 +1,3 @@
1
1
  module JIRA
2
- VERSION = "0.1.2"
3
- end
2
+ VERSION = "0.1.4"
3
+ end
@@ -5,7 +5,7 @@ describe JIRA::BaseFactory do
5
5
  class JIRA::Resource::FooFactory < JIRA::BaseFactory ; end
6
6
  class JIRA::Resource::Foo ; end
7
7
 
8
- let(:client) { mock() }
8
+ let(:client) { double() }
9
9
  subject { JIRA::Resource::FooFactory.new(client) }
10
10
 
11
11
  it "initializes correctly" do
@@ -29,7 +29,7 @@ describe JIRA::BaseFactory do
29
29
  end
30
30
 
31
31
  it "proxies build to the target class" do
32
- attrs = mock()
32
+ attrs = double()
33
33
  JIRA::Resource::Foo.should_receive(:build).with(client, attrs)
34
34
  subject.build(attrs)
35
35
  end
@@ -31,7 +31,7 @@ describe JIRA::Base do
31
31
 
32
32
  end
33
33
 
34
- let(:client) { mock("client") }
34
+ let(:client) { double("client") }
35
35
  let(:attrs) { Hash.new }
36
36
 
37
37
  subject { JIRA::Resource::Deadbeef.new(client, :attrs => attrs) }
@@ -42,7 +42,7 @@ describe JIRA::Base do
42
42
  end
43
43
 
44
44
  it "returns all the deadbeefs" do
45
- response = mock()
45
+ response = double()
46
46
  response.should_receive(:body).and_return('[{"self":"http://deadbeef/","id":"98765"}]')
47
47
  client.should_receive(:get).with('/jira/rest/api/2/deadbeef').and_return(response)
48
48
  JIRA::Resource::Deadbeef.should_receive(:collection_path).and_return('/jira/rest/api/2/deadbeef')
@@ -56,7 +56,7 @@ describe JIRA::Base do
56
56
  end
57
57
 
58
58
  it "finds a deadbeef by id" do
59
- response = mock()
59
+ response = double()
60
60
  response.stub(:body).and_return('{"self":"http://deadbeef/","id":"98765"}')
61
61
  client.should_receive(:get).with('/jira/rest/api/2/deadbeef/98765').and_return(response)
62
62
  JIRA::Resource::Deadbeef.should_receive(:collection_path).and_return('/jira/rest/api/2/deadbeef')
@@ -142,7 +142,7 @@ describe JIRA::Base do
142
142
  describe "not cached" do
143
143
 
144
144
  before(:each) do
145
- response = mock()
145
+ response = double()
146
146
  response.stub(:body).and_return('{"self":"http://deadbeef/","id":"98765"}')
147
147
  client.should_receive(:get).with('/jira/rest/api/2/deadbeef/98765').and_return(response)
148
148
  JIRA::Resource::Deadbeef.should_receive(:collection_path).and_return('/jira/rest/api/2/deadbeef')
@@ -180,7 +180,7 @@ describe JIRA::Base do
180
180
 
181
181
  describe "save" do
182
182
 
183
- let(:response) { mock() }
183
+ let(:response) { double() }
184
184
 
185
185
  subject { JIRA::Resource::Deadbeef.new(client) }
186
186
 
@@ -223,7 +223,7 @@ describe JIRA::Base do
223
223
  end
224
224
 
225
225
  describe "save!" do
226
- let(:response) { mock() }
226
+ let(:response) { double() }
227
227
 
228
228
  subject { JIRA::Resource::Deadbeef.new(client) }
229
229
 
@@ -382,7 +382,7 @@ describe JIRA::Base do
382
382
  subject { JIRA::Resource::Deadbeef.new(client, :attrs => {}) }
383
383
 
384
384
  it "sets the attrs from a response" do
385
- response = mock()
385
+ response = double()
386
386
  response.stub(:body).and_return('{"foo":"bar"}')
387
387
 
388
388
  subject.set_attrs_from_response(response).should == {'foo' => 'bar'}
@@ -390,7 +390,7 @@ describe JIRA::Base do
390
390
  end
391
391
 
392
392
  it "doesn't clobber existing attrs not in response" do
393
- response = mock()
393
+ response = double()
394
394
  response.stub(:body).and_return('{"foo":"bar"}')
395
395
 
396
396
  subject.attrs = {'flum' => 'flar'}
@@ -400,7 +400,7 @@ describe JIRA::Base do
400
400
  end
401
401
 
402
402
  it "handles nil response body" do
403
- response = mock()
403
+ response = double()
404
404
  response.stub(:body).and_return(nil)
405
405
 
406
406
  subject.attrs = {'flum' => 'flar'}
@@ -13,7 +13,7 @@ describe JIRA::Client do
13
13
  let(:clients) { [oauth_client, basic_client] }
14
14
 
15
15
  let(:response) do
16
- response = mock("response")
16
+ response = double("response")
17
17
  response.stub(:kind_of?).with(Net::HTTPSuccess).and_return(true)
18
18
  response
19
19
  end
@@ -64,7 +64,7 @@ describe JIRA::Client do
64
64
  describe "like oauth" do
65
65
 
66
66
  it "allows setting an access token" do
67
- token = mock()
67
+ token = double()
68
68
  OAuth::AccessToken.should_receive(:new).with(oauth_client.consumer, 'foo', 'bar').and_return(token)
69
69
  access_token = oauth_client.set_access_token('foo', 'bar')
70
70
 
@@ -75,7 +75,7 @@ describe JIRA::Client do
75
75
  it "allows initializing the access token" do
76
76
  request_token = OAuth::RequestToken.new(oauth_client.consumer)
77
77
  oauth_client.consumer.stub(:get_request_token => request_token)
78
- mock_access_token = mock()
78
+ mock_access_token = double()
79
79
  request_token.should_receive(:get_access_token).with(:oauth_verifier => 'abc123').and_return(mock_access_token)
80
80
  oauth_client.init_access_token(:oauth_verifier => 'abc123')
81
81
  oauth_client.access_token.should == mock_access_token
@@ -178,7 +178,7 @@ describe JIRA::Client do
178
178
  end
179
179
 
180
180
  it "finds a single project" do
181
- find_result = mock()
181
+ find_result = double()
182
182
  JIRA::Resource::Project.should_receive(:find).with(oauth_client, '123').and_return(find_result)
183
183
  JIRA::Resource::Project.should_receive(:find).with(basic_client, '123').and_return(find_result)
184
184
  oauth_client.Project.find('123').should == find_result
@@ -6,8 +6,8 @@ describe JIRA::HasManyProxy do
6
6
 
7
7
  subject { JIRA::HasManyProxy.new(parent, Foo, collection) }
8
8
 
9
- let(:parent) { mock("parent") }
10
- let(:collection) { mock("collection") }
9
+ let(:parent) { double("parent") }
10
+ let(:collection) { double("collection") }
11
11
 
12
12
  it "has a target class" do
13
13
  subject.target_class.should == Foo
@@ -22,8 +22,8 @@ describe JIRA::HasManyProxy do
22
22
  end
23
23
 
24
24
  it "can build a new instance" do
25
- client = mock('client')
26
- foo = mock('foo')
25
+ client = double('client')
26
+ foo = double('foo')
27
27
  parent.stub(:client => client, :to_sym => :parent)
28
28
  Foo.should_receive(:new).with(client, :attrs => {'foo' => 'bar'}, :parent => parent).and_return(foo)
29
29
  collection.should_receive(:<<).with(foo)
@@ -31,8 +31,8 @@ describe JIRA::HasManyProxy do
31
31
  end
32
32
 
33
33
  it "can get all the instances" do
34
- foo = mock('foo')
35
- client = mock('client')
34
+ foo = double('foo')
35
+ client = double('client')
36
36
  parent.stub(:client => client, :to_sym => :parent)
37
37
  Foo.should_receive(:all).with(client, :parent => parent).and_return(foo)
38
38
  subject.all.should == foo
@@ -8,7 +8,7 @@ describe JIRA::HttpClient do
8
8
  end
9
9
 
10
10
  let(:response) do
11
- response = mock("response")
11
+ response = double("response")
12
12
  response.stub(:kind_of?).with(Net::HTTPSuccess).and_return(true)
13
13
  response
14
14
  end
@@ -19,9 +19,9 @@ describe JIRA::HttpClient do
19
19
 
20
20
  it "responds to the http methods" do
21
21
  body = ''
22
- headers = mock()
23
- basic_auth_http_conn = mock()
24
- request = mock()
22
+ headers = double()
23
+ basic_auth_http_conn = double()
24
+ request = double()
25
25
  basic_client.stub(:basic_auth_http_conn => basic_auth_http_conn)
26
26
  request.should_receive(:basic_auth).with(basic_client.options[:username], basic_client.options[:password]).exactly(5).times.and_return(request)
27
27
  basic_auth_http_conn.should_receive(:request).exactly(5).times.with(request).and_return(response)
@@ -38,9 +38,9 @@ describe JIRA::HttpClient do
38
38
 
39
39
  it "performs a basic http client request" do
40
40
  body = nil
41
- headers = mock()
42
- basic_auth_http_conn = mock()
43
- http_request = mock()
41
+ headers = double()
42
+ basic_auth_http_conn = double()
43
+ http_request = double()
44
44
  Net::HTTP::Get.should_receive(:new).with('/foo', headers).and_return(http_request)
45
45
 
46
46
  basic_auth_http_conn.should_receive(:request).with(http_request).and_return(response)
@@ -55,10 +55,10 @@ describe JIRA::HttpClient do
55
55
  end
56
56
 
57
57
  it "sets up a http connection with options" do
58
- http_conn = mock()
59
- uri = mock()
60
- host = mock()
61
- port = mock()
58
+ http_conn = double()
59
+ uri = double()
60
+ host = double()
61
+ port = double()
62
62
  uri.should_receive(:host).and_return(host)
63
63
  uri.should_receive(:port).and_return(port)
64
64
  Net::HTTP.should_receive(:new).with(host, port).and_return(http_conn)
@@ -68,8 +68,8 @@ describe JIRA::HttpClient do
68
68
  end
69
69
 
70
70
  it "returns a http connection" do
71
- http_conn = mock()
72
- uri = mock()
71
+ http_conn = double()
72
+ uri = double()
73
73
  basic_client.should_receive(:uri).and_return(uri)
74
74
  basic_client.should_receive(:http_conn).and_return(http_conn)
75
75
  basic_client.basic_auth_http_conn.should == http_conn
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe JIRA::HTTPError do
4
4
 
5
5
  let(:response) {
6
- response = mock("response")
6
+ response = double("response")
7
7
  response.stub(:code => 401)
8
8
  response.stub(:message => "A MESSAGE WOO")
9
9
  response
@@ -9,7 +9,7 @@ describe JIRA::OauthClient do
9
9
  end
10
10
 
11
11
  let(:response) do
12
- response = mock("response")
12
+ response = double("response")
13
13
  response.stub(:kind_of?).with(Net::HTTPSuccess).and_return(true)
14
14
  response
15
15
  end
@@ -37,7 +37,7 @@ describe JIRA::OauthClient do
37
37
  end
38
38
 
39
39
  it "allows setting the request token" do
40
- token = mock()
40
+ token = double()
41
41
  OAuth::RequestToken.should_receive(:new).with(oauth_client.consumer, 'foo', 'bar').and_return(token)
42
42
 
43
43
  request_token = oauth_client.set_request_token('foo', 'bar')
@@ -59,7 +59,7 @@ describe JIRA::OauthClient do
59
59
  it "initializes" do
60
60
  request_token = OAuth::RequestToken.new(oauth_client.consumer)
61
61
  oauth_client.consumer.stub(:get_request_token => request_token)
62
- mock_access_token = mock()
62
+ mock_access_token = double()
63
63
  request_token.should_receive(:get_access_token).with(:oauth_verifier => 'abc123').and_return(mock_access_token)
64
64
  oauth_client.init_access_token(:oauth_verifier => 'abc123')
65
65
  oauth_client.access_token.should == mock_access_token
@@ -73,7 +73,7 @@ describe JIRA::OauthClient do
73
73
  end
74
74
 
75
75
  it "allows setting the access token" do
76
- token = mock()
76
+ token = double()
77
77
  OAuth::AccessToken.should_receive(:new).with(oauth_client.consumer, 'foo', 'bar').and_return(token)
78
78
 
79
79
  access_token = oauth_client.set_access_token('foo', 'bar')
@@ -85,8 +85,8 @@ describe JIRA::OauthClient do
85
85
 
86
86
  describe "http" do
87
87
  it "responds to the http methods" do
88
- headers = mock()
89
- mock_access_token = mock()
88
+ headers = double()
89
+ mock_access_token = double()
90
90
  oauth_client.stub(:access_token => mock_access_token)
91
91
  [:delete, :get, :head].each do |method|
92
92
  mock_access_token.should_receive(method).with('/path', headers).and_return(response)
@@ -100,8 +100,8 @@ describe JIRA::OauthClient do
100
100
 
101
101
  it "performs a request" do
102
102
  body = nil
103
- headers = mock()
104
- access_token = mock()
103
+ headers = double()
104
+ access_token = double()
105
105
  access_token.should_receive(:send).with(:get, '/foo', headers).and_return(response)
106
106
  oauth_client.stub(:access_token => access_token)
107
107
  oauth_client.request(:get, '/foo', body, headers)
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe JIRA::RequestClient do
4
4
 
5
5
  it "raises an exception for non success responses" do
6
- response = mock()
6
+ response = double()
7
7
  response.stub(:kind_of?).with(Net::HTTPSuccess).and_return(false)
8
8
  rc = JIRA::RequestClient.new
9
9
  rc.should_receive(:make_request).with(:get, '/foo', '', {}).and_return(response)
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe JIRA::Resource::Attachment do
4
4
 
5
- let(:client) { mock() }
5
+ let(:client) { double() }
6
6
 
7
7
  describe "relationships" do
8
8
  subject {
@@ -2,10 +2,10 @@ require 'spec_helper'
2
2
 
3
3
  describe JIRA::Resource::Issue do
4
4
 
5
- let(:client) { mock() }
5
+ let(:client) { double() }
6
6
 
7
7
  it "should find an issue by key or id" do
8
- response = mock()
8
+ response = double()
9
9
  response.stub(:body).and_return('{"key":"foo","id":"101"}')
10
10
  JIRA::Resource::Issue.stub(:collection_path).and_return('/jira/rest/api/2/issue')
11
11
  client.should_receive(:get).with('/jira/rest/api/2/issue/foo').
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe JIRA::Resource::ProjectFactory do
4
4
 
5
- let(:client) { mock() }
5
+ let(:client) { double() }
6
6
  subject { JIRA::Resource::ProjectFactory.new(client) }
7
7
 
8
8
  it "initializes correctly" do
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe JIRA::Resource::Project do
4
4
 
5
- let(:client) { mock() }
5
+ let(:client) { double() }
6
6
 
7
7
  describe "relationships" do
8
8
  subject {
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe JIRA::Resource::Worklog do
4
4
 
5
- let(:client) { mock() }
5
+ let(:client) { double() }
6
6
 
7
7
  describe "relationships" do
8
8
  subject {
metadata CHANGED
@@ -1,152 +1,137 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jira-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
5
- prerelease:
4
+ version: 0.1.4
6
5
  platform: ruby
7
6
  authors:
8
- - Trineo Ltd
7
+ - SUMO Heavy Industries
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-11-21 00:00:00.000000000 Z
11
+ date: 2013-12-19 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: oauth
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: oauth
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: railties
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
- type: :runtime
48
+ type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
- name: railties
56
+ name: activesupport
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
- type: :development
62
+ type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: activesupport
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
- type: :runtime
76
+ type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
- name: activesupport
84
+ name: webmock
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - '>='
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - '>='
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
- name: webmock
98
+ name: rspec
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - '>='
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - '>='
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  - !ruby/object:Gem::Dependency
127
- name: rspec
112
+ name: rake
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ! '>='
115
+ - - '>='
132
116
  - !ruby/object:Gem::Version
133
117
  version: '0'
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ! '>='
122
+ - - '>='
140
123
  - !ruby/object:Gem::Version
141
124
  version: '0'
142
- description: API for JIRA 5
125
+ description: API for JIRA
143
126
  email:
144
127
  executables: []
145
128
  extensions: []
146
129
  extra_rdoc_files: []
147
130
  files:
148
131
  - .gitignore
132
+ - .travis.yml
149
133
  - Gemfile
134
+ - LICENSE.txt
150
135
  - README.rdoc
151
136
  - Rakefile
152
137
  - example.rb
@@ -238,34 +223,89 @@ files:
238
223
  - spec/support/matchers/have_many.rb
239
224
  - spec/support/matchers/have_one.rb
240
225
  - spec/support/shared_examples/integration.rb
241
- homepage: http://trineo.co.nz
226
+ homepage: http://www.sumoheavy.com
242
227
  licenses: []
228
+ metadata: {}
243
229
  post_install_message:
244
230
  rdoc_options: []
245
231
  require_paths:
246
232
  - lib
247
233
  required_ruby_version: !ruby/object:Gem::Requirement
248
- none: false
249
234
  requirements:
250
- - - ! '>='
235
+ - - '>='
251
236
  - !ruby/object:Gem::Version
252
237
  version: '0'
253
- segments:
254
- - 0
255
- hash: -155705129049580202
256
238
  required_rubygems_version: !ruby/object:Gem::Requirement
257
- none: false
258
239
  requirements:
259
- - - ! '>='
240
+ - - '>='
260
241
  - !ruby/object:Gem::Version
261
242
  version: '0'
262
- segments:
263
- - 0
264
- hash: -155705129049580202
265
243
  requirements: []
266
244
  rubyforge_project: jira-ruby
267
- rubygems_version: 1.8.24
245
+ rubygems_version: 2.0.6
268
246
  signing_key:
269
- specification_version: 3
270
- summary: Ruby Gem for use with the Atlassian JIRA 5 REST API
271
- test_files: []
247
+ specification_version: 4
248
+ summary: Ruby Gem for use with the Atlassian JIRA REST API
249
+ test_files:
250
+ - spec/integration/attachment_spec.rb
251
+ - spec/integration/comment_spec.rb
252
+ - spec/integration/component_spec.rb
253
+ - spec/integration/issue_spec.rb
254
+ - spec/integration/issuetype_spec.rb
255
+ - spec/integration/priority_spec.rb
256
+ - spec/integration/project_spec.rb
257
+ - spec/integration/status_spec.rb
258
+ - spec/integration/user_spec.rb
259
+ - spec/integration/version_spec.rb
260
+ - spec/integration/worklog_spec.rb
261
+ - spec/jira/base_factory_spec.rb
262
+ - spec/jira/base_spec.rb
263
+ - spec/jira/client_spec.rb
264
+ - spec/jira/has_many_proxy_spec.rb
265
+ - spec/jira/http_client_spec.rb
266
+ - spec/jira/http_error_spec.rb
267
+ - spec/jira/oauth_client_spec.rb
268
+ - spec/jira/request_client_spec.rb
269
+ - spec/jira/resource/attachment_spec.rb
270
+ - spec/jira/resource/issue_spec.rb
271
+ - spec/jira/resource/project_factory_spec.rb
272
+ - spec/jira/resource/project_spec.rb
273
+ - spec/jira/resource/worklog_spec.rb
274
+ - spec/mock_responses/attachment/10000.json
275
+ - spec/mock_responses/component.post.json
276
+ - spec/mock_responses/component/10000.invalid.put.json
277
+ - spec/mock_responses/component/10000.json
278
+ - spec/mock_responses/component/10000.put.json
279
+ - spec/mock_responses/issue.json
280
+ - spec/mock_responses/issue.post.json
281
+ - spec/mock_responses/issue/10002.invalid.put.json
282
+ - spec/mock_responses/issue/10002.json
283
+ - spec/mock_responses/issue/10002.put.missing_field_update.json
284
+ - spec/mock_responses/issue/10002/comment.json
285
+ - spec/mock_responses/issue/10002/comment.post.json
286
+ - spec/mock_responses/issue/10002/comment/10000.json
287
+ - spec/mock_responses/issue/10002/comment/10000.put.json
288
+ - spec/mock_responses/issue/10002/worklog.json
289
+ - spec/mock_responses/issue/10002/worklog.post.json
290
+ - spec/mock_responses/issue/10002/worklog/10000.json
291
+ - spec/mock_responses/issue/10002/worklog/10000.put.json
292
+ - spec/mock_responses/issuetype.json
293
+ - spec/mock_responses/issuetype/5.json
294
+ - spec/mock_responses/priority.json
295
+ - spec/mock_responses/priority/1.json
296
+ - spec/mock_responses/project.json
297
+ - spec/mock_responses/project/SAMPLEPROJECT.issues.json
298
+ - spec/mock_responses/project/SAMPLEPROJECT.json
299
+ - spec/mock_responses/status.json
300
+ - spec/mock_responses/status/1.json
301
+ - spec/mock_responses/user_username=admin.json
302
+ - spec/mock_responses/version.post.json
303
+ - spec/mock_responses/version/10000.invalid.put.json
304
+ - spec/mock_responses/version/10000.json
305
+ - spec/mock_responses/version/10000.put.json
306
+ - spec/spec_helper.rb
307
+ - spec/support/clients_helper.rb
308
+ - spec/support/matchers/have_attributes.rb
309
+ - spec/support/matchers/have_many.rb
310
+ - spec/support/matchers/have_one.rb
311
+ - spec/support/shared_examples/integration.rb