leankit 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Manifest +12 -12
- data/Rakefile +1 -1
- data/leankit.gemspec +4 -4
- data/lib/leankit.rb +13 -0
- data/lib/{leankitkanban → leankit}/archive.rb +1 -1
- data/lib/{leankitkanban → leankit}/backlog.rb +1 -1
- data/lib/{leankitkanban → leankit}/board.rb +1 -1
- data/lib/{leankitkanban → leankit}/card.rb +1 -1
- data/lib/{leankitkanban → leankit}/config.rb +2 -2
- data/lib/leankit/version.rb +3 -0
- data/lib/leankit_request.rb +4 -4
- data/spec/{leankitkanban → leankit}/archive_spec.rb +3 -3
- data/spec/{leankitkanban → leankit}/backlog_spec.rb +3 -3
- data/spec/{leankitkanban → leankit}/board_spec.rb +11 -11
- data/spec/{leankitkanban → leankit}/card_spec.rb +19 -19
- data/spec/leankit/config_spec.rb +59 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/support/config_helper.rb +3 -3
- metadata +20 -20
- data/lib/leankitkanban.rb +0 -13
- data/lib/leankitkanban/version.rb +0 -3
- data/spec/leankitkanban/config_spec.rb +0 -59
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 820df050d2c8235658dc2c12575ede3920eb9211
|
4
|
+
data.tar.gz: e8a32cfe879da9d79ca33ff26540f10afb42bd6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfbc805f4d5fff35dd962b8fe1fbf70b4d57ddd910950df24c9f3670c8633d65439a32234f9097aa6a4a19f6dbc03b26b0427da83f8bb05bc9b103b2d8ac4d5d
|
7
|
+
data.tar.gz: 13e31989c361a144523774a01302064367fb25eed156b76bd5626517fa9d1e3edae9935ca77f1b089311cdeb72d35117556785abdae8ca222dd4ba6219d5605b
|
data/Manifest
CHANGED
@@ -4,18 +4,18 @@ LICENSE
|
|
4
4
|
Manifest
|
5
5
|
README.md
|
6
6
|
Rakefile
|
7
|
+
lib/leankit.rb
|
8
|
+
lib/leankit/archive.rb
|
9
|
+
lib/leankit/backlog.rb
|
10
|
+
lib/leankit/board.rb
|
11
|
+
lib/leankit/card.rb
|
12
|
+
lib/leankit/config.rb
|
13
|
+
lib/leankit/version.rb
|
7
14
|
lib/leankit_request.rb
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
lib/leankitkanban/config.rb
|
14
|
-
lib/leankitkanban/version.rb
|
15
|
-
spec/leankitkanban/archive_spec.rb
|
16
|
-
spec/leankitkanban/backlog_spec.rb
|
17
|
-
spec/leankitkanban/board_spec.rb
|
18
|
-
spec/leankitkanban/card_spec.rb
|
19
|
-
spec/leankitkanban/config_spec.rb
|
15
|
+
spec/leankit/archive_spec.rb
|
16
|
+
spec/leankit/backlog_spec.rb
|
17
|
+
spec/leankit/board_spec.rb
|
18
|
+
spec/leankit/card_spec.rb
|
19
|
+
spec/leankit/config_spec.rb
|
20
20
|
spec/spec_helper.rb
|
21
21
|
spec/support/config_helper.rb
|
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ RSpec::Core::RakeTask.new(:spec)
|
|
7
7
|
|
8
8
|
task :default => :spec
|
9
9
|
|
10
|
-
Echoe.new('leankit', '0.1.
|
10
|
+
Echoe.new('leankit', '0.1.6') do |p|
|
11
11
|
p.description = "Ruby Wrapper around LeanKitKanban Api"
|
12
12
|
p.url = "http://github.com/noahpryor/leankitkanban"
|
13
13
|
p.author = "Noah Pryor"
|
data/leankit.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: leankit 0.1.
|
2
|
+
# stub: leankit 0.1.6 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "leankit"
|
6
|
-
s.version = "0.1.
|
6
|
+
s.version = "0.1.6"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib"]
|
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.date = "2014-04-24"
|
12
12
|
s.description = "Ruby Wrapper around LeanKitKanban Api"
|
13
13
|
s.email = "noah@noahpryor.com"
|
14
|
-
s.extra_rdoc_files = ["LICENSE", "README.md", "lib/
|
15
|
-
s.files = ["Gemfile", "Gemfile.lock", "LICENSE", "Manifest", "README.md", "Rakefile", "leankit.gemspec", "lib/
|
14
|
+
s.extra_rdoc_files = ["LICENSE", "README.md", "lib/leankit.rb", "lib/leankit/archive.rb", "lib/leankit/backlog.rb", "lib/leankit/board.rb", "lib/leankit/card.rb", "lib/leankit/config.rb", "lib/leankit/version.rb", "lib/leankit_request.rb"]
|
15
|
+
s.files = ["Gemfile", "Gemfile.lock", "LICENSE", "Manifest", "README.md", "Rakefile", "leankit.gemspec", "lib/leankit.rb", "lib/leankit/archive.rb", "lib/leankit/backlog.rb", "lib/leankit/board.rb", "lib/leankit/card.rb", "lib/leankit/config.rb", "lib/leankit/version.rb", "lib/leankit_request.rb", "spec/leankit/archive_spec.rb", "spec/leankit/backlog_spec.rb", "spec/leankit/board_spec.rb", "spec/leankit/card_spec.rb", "spec/leankit/config_spec.rb", "spec/spec_helper.rb", "spec/support/config_helper.rb"]
|
16
16
|
s.homepage = "http://github.com/noahpryor/leankitkanban"
|
17
17
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Leankit", "--main", "README.md"]
|
18
18
|
s.rubyforge_project = "leankit"
|
data/lib/leankit.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require "uri"
|
2
|
+
require "httparty"
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
require File.join(File.dirname(__FILE__), 'leankit_request')
|
6
|
+
require File.join(File.dirname(__FILE__), 'leankit', 'config')
|
7
|
+
require File.join(File.dirname(__FILE__), 'leankit', 'board')
|
8
|
+
require File.join(File.dirname(__FILE__), 'leankit', 'card')
|
9
|
+
require File.join(File.dirname(__FILE__), 'leankit', 'backlog')
|
10
|
+
require File.join(File.dirname(__FILE__), 'leankit', 'archive')
|
11
|
+
|
12
|
+
module LeanKit
|
13
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module LeanKit
|
2
2
|
module Config
|
3
3
|
class NoCredentials < StandardError; end
|
4
4
|
class NoAccount < StandardError; end
|
@@ -6,7 +6,7 @@ module LeanKitKanban
|
|
6
6
|
class << self
|
7
7
|
attr_accessor :email, :password, :account
|
8
8
|
|
9
|
-
LKK_DOMAIN = "
|
9
|
+
LKK_DOMAIN = "leankit.com"
|
10
10
|
API_SUFFIX = "/Kanban/API"
|
11
11
|
|
12
12
|
def validate
|
data/lib/leankit_request.rb
CHANGED
@@ -8,15 +8,15 @@ module LeanKitRequest
|
|
8
8
|
|
9
9
|
private
|
10
10
|
def get(api_call)
|
11
|
-
url = "#{
|
12
|
-
response = super(url,
|
11
|
+
url = "#{LeanKit::Config.uri}#{api_call}"
|
12
|
+
response = super(url, LeanKit::Config.basic_auth_hash)
|
13
13
|
parse_body(response.body)
|
14
14
|
end
|
15
15
|
|
16
16
|
def post(api_call, body)
|
17
|
-
url = "#{
|
17
|
+
url = "#{LeanKit::Config.uri}#{api_call}"
|
18
18
|
headers("Content-Type" => "application/json")
|
19
|
-
request =
|
19
|
+
request = LeanKit::Config.basic_auth_hash
|
20
20
|
request[:body] = body.to_json
|
21
21
|
response = super(url, request)
|
22
22
|
parse_body(response.body)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe LeanKit::Archive do
|
4
4
|
describe :fetch do
|
5
5
|
before :each do
|
6
6
|
@board_id = mock("boardID")
|
@@ -8,8 +8,8 @@ describe LeanKitKanban::Archive do
|
|
8
8
|
|
9
9
|
it "gets the board archive" do
|
10
10
|
api_call = "/Board/#{@board_id}/Archive"
|
11
|
-
|
12
|
-
|
11
|
+
LeanKit::Archive.should_receive(:get).with(api_call)
|
12
|
+
LeanKit::Archive.fetch(@board_id)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe LeanKit::Backlog do
|
4
4
|
describe :fetch do
|
5
5
|
before :each do
|
6
6
|
@board_id = mock("boardID")
|
@@ -8,8 +8,8 @@ describe LeanKitKanban::Backlog do
|
|
8
8
|
|
9
9
|
it "gets the board backlog" do
|
10
10
|
api_call = "/Board/#{@board_id}/Backlog"
|
11
|
-
|
12
|
-
|
11
|
+
LeanKit::Backlog.should_receive(:get).with(api_call)
|
12
|
+
LeanKit::Backlog.fetch(@board_id)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe LeanKit::Board do
|
4
4
|
before :all do
|
5
5
|
ConfigHelper.set_test_config
|
6
6
|
end
|
@@ -8,8 +8,8 @@ describe LeanKitKanban::Board do
|
|
8
8
|
describe :all do
|
9
9
|
it "gets all boards for that account" do
|
10
10
|
api_call = "/Boards"
|
11
|
-
|
12
|
-
|
11
|
+
LeanKit::Board.should_receive(:get).with(api_call)
|
12
|
+
LeanKit::Board.all
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -20,8 +20,8 @@ describe LeanKitKanban::Board do
|
|
20
20
|
|
21
21
|
it "gets the board whose id is passed as parameter" do
|
22
22
|
api_call = "/Boards/#{@board_id}"
|
23
|
-
|
24
|
-
|
23
|
+
LeanKit::Board.should_receive(:get).with(api_call)
|
24
|
+
LeanKit::Board.find(@board_id)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -32,8 +32,8 @@ describe LeanKitKanban::Board do
|
|
32
32
|
|
33
33
|
it "gets the identifiers of the board whose id is passed as parameter" do
|
34
34
|
api_call = "/Board/#{@board_id}/GetBoardIdentifiers"
|
35
|
-
|
36
|
-
|
35
|
+
LeanKit::Board.should_receive(:get).with(api_call)
|
36
|
+
LeanKit::Board.get_identifiers(@board_id)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -45,8 +45,8 @@ describe LeanKitKanban::Board do
|
|
45
45
|
|
46
46
|
it "gets a greater version of the board than the one passed" do
|
47
47
|
api_call = "/Board/#{@board_id}/BoardVersion/#{@version_id}/GetNewerIfExists"
|
48
|
-
|
49
|
-
|
48
|
+
LeanKit::Board.should_receive(:get).with(api_call)
|
49
|
+
LeanKit::Board.get_newer_if_exists(@board_id, @version_id)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
@@ -58,8 +58,8 @@ describe LeanKitKanban::Board do
|
|
58
58
|
|
59
59
|
it "gets a greater version of the board than the one passed" do
|
60
60
|
api_call = "/Board/#{@board_id}/BoardVersion/#{@version_id}/GetBoardHistorySince"
|
61
|
-
|
62
|
-
|
61
|
+
LeanKit::Board.should_receive(:get).with(api_call)
|
62
|
+
LeanKit::Board.get_board_history_since(@board_id, @version_id)
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe LeanKit::Card do
|
4
4
|
describe :find do
|
5
5
|
before :each do
|
6
6
|
@board_id = mock("boardID")
|
@@ -9,8 +9,8 @@ describe LeanKitKanban::Card do
|
|
9
9
|
|
10
10
|
it "gets the board card whose id is passed" do
|
11
11
|
api_call = "/Board/#{@board_id}/GetCard/#{@card_id}"
|
12
|
-
|
13
|
-
|
12
|
+
LeanKit::Card.should_receive(:get).with(api_call)
|
13
|
+
LeanKit::Card.find(@board_id, @card_id)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -22,8 +22,8 @@ describe LeanKitKanban::Card do
|
|
22
22
|
|
23
23
|
it "gets the board card whose id is passed" do
|
24
24
|
api_call = "/Board/#{@board_id}/GetCardByExternalId/#{@external_id}"
|
25
|
-
|
26
|
-
|
25
|
+
LeanKit::Card.should_receive(:get).with(api_call)
|
26
|
+
LeanKit::Card.find_by_external_id(@board_id, @external_id)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -35,8 +35,8 @@ describe LeanKitKanban::Card do
|
|
35
35
|
|
36
36
|
it "deletes the card whose ids are passed" do
|
37
37
|
api_call = "/Board/#{@board_id}/DeleteCards"
|
38
|
-
|
39
|
-
|
38
|
+
LeanKit::Card.should_receive(:post).with(api_call, @card_ids)
|
39
|
+
LeanKit::Card.delete_multiple(@board_id, @card_ids)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -48,8 +48,8 @@ describe LeanKitKanban::Card do
|
|
48
48
|
|
49
49
|
it "deletes the board card whose id is passed" do
|
50
50
|
api_call = "/Board/#{@board_id}/DeleteCard/#{@card_id}"
|
51
|
-
|
52
|
-
|
51
|
+
LeanKit::Card.should_receive(:post).with(api_call, {})
|
52
|
+
LeanKit::Card.delete(@board_id, @card_id)
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
@@ -63,8 +63,8 @@ describe LeanKitKanban::Card do
|
|
63
63
|
|
64
64
|
it "adds the card into the lane and position provided" do
|
65
65
|
api_call = "/Board/#{@board_id}/AddCard/Lane/#{@lane_id}/Position/#{@position}"
|
66
|
-
|
67
|
-
|
66
|
+
LeanKit::Card.should_receive(:post).with(api_call, @body)
|
67
|
+
LeanKit::Card.add(@board_id, @lane_id, @position, @body)
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
@@ -76,8 +76,8 @@ describe LeanKitKanban::Card do
|
|
76
76
|
|
77
77
|
it "updates the card using the title and description provided" do
|
78
78
|
api_call = "/Board/#{@board_id}/UpdateCard/"
|
79
|
-
|
80
|
-
|
79
|
+
LeanKit::Card.should_receive(:post).with(api_call, @body)
|
80
|
+
LeanKit::Card.update(@board_id, @body)
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
@@ -98,16 +98,16 @@ describe LeanKitKanban::Card do
|
|
98
98
|
|
99
99
|
it "adds the cards into the lanes and positions provided" do
|
100
100
|
api_call = "/Board/#{@board_id}/AddCards?wipOverrideComment=" + URI::encode(@wip_comment)
|
101
|
-
|
102
|
-
|
101
|
+
LeanKit::Card.should_receive(:post).with(api_call, @cards)
|
102
|
+
LeanKit::Card.add_multiple(@board_id, @wip_comment, @cards)
|
103
103
|
end
|
104
104
|
end
|
105
105
|
|
106
106
|
describe :history do
|
107
107
|
it "gets the history of card which id is provided" do
|
108
108
|
api_call = "/Card/History/#{@board_id}/#{@card_id}"
|
109
|
-
|
110
|
-
|
109
|
+
LeanKit::Card.should_receive(:get).with(api_call)
|
110
|
+
LeanKit::Card.history(@board_id, @card_id)
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
@@ -116,8 +116,8 @@ describe LeanKitKanban::Card do
|
|
116
116
|
@lane_id = 12
|
117
117
|
@position = 0
|
118
118
|
api_call = "/Board/#{@board_id}/MoveCard/#{@card_id}/Lane/#{@lane_id}/Position/0"
|
119
|
-
|
120
|
-
|
119
|
+
LeanKit::Card.should_receive(:post).with(api_call,{})
|
120
|
+
LeanKit::Card.move(@board_id, @card_id, @lane_id, @position)
|
121
121
|
end
|
122
122
|
end
|
123
123
|
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe LeanKit::Config do
|
4
|
+
describe :validate do
|
5
|
+
before :each do
|
6
|
+
ConfigHelper.set_test_config
|
7
|
+
end
|
8
|
+
|
9
|
+
context "when the config is not set" do
|
10
|
+
it "raises a no credentials error when no email" do
|
11
|
+
LeanKit::Config.email = nil
|
12
|
+
lambda{ LeanKit::Config.validate }.should raise_error(LeanKit::Config::NoCredentials)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "raises a no credentials error when no password" do
|
16
|
+
LeanKit::Config.password = nil
|
17
|
+
lambda{ LeanKit::Config.validate }.should raise_error(LeanKit::Config::NoCredentials)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "raises a no account error when no account" do
|
21
|
+
LeanKit::Config.account = nil
|
22
|
+
lambda{ LeanKit::Config.validate }.should raise_error(LeanKit::Config::NoAccount)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context "when the config is set" do
|
27
|
+
it "doesn't raise a no credentials error" do
|
28
|
+
lambda{ LeanKit::Config.validate }.should_not raise_error(LeanKit::Config::NoCredentials)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "doesn't raise a no account error" do
|
32
|
+
lambda{ LeanKit::Config.validate }.should_not raise_error(LeanKit::Config::NoAccount)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe :uri do
|
38
|
+
it "validates the config" do
|
39
|
+
LeanKit::Config.should_receive(:validate)
|
40
|
+
LeanKit::Config.uri
|
41
|
+
end
|
42
|
+
|
43
|
+
it "returns the domain including the account name" do
|
44
|
+
LeanKit::Config.uri.should eql "http://#{TEST_ACCOUNT}.leankit.com/Kanban/API"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe :basic_auth_hash do
|
49
|
+
it "validates the config" do
|
50
|
+
LeanKit::Config.should_receive(:validate)
|
51
|
+
LeanKit::Config.basic_auth_hash
|
52
|
+
end
|
53
|
+
|
54
|
+
it "returns a hash with the credentials" do
|
55
|
+
expected_hash = {:basic_auth => {:username => EMAIL, :password => PASSWORD}}
|
56
|
+
LeanKit::Config.basic_auth_hash.should eql expected_hash
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module ConfigHelper
|
2
2
|
def self.set_test_config
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
LeanKit::Config.email = EMAIL
|
4
|
+
LeanKit::Config.password = PASSWORD
|
5
|
+
LeanKit::Config.account = TEST_ACCOUNT
|
6
6
|
end
|
7
7
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leankit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noah Pryor
|
@@ -73,14 +73,14 @@ extensions: []
|
|
73
73
|
extra_rdoc_files:
|
74
74
|
- LICENSE
|
75
75
|
- README.md
|
76
|
+
- lib/leankit.rb
|
77
|
+
- lib/leankit/archive.rb
|
78
|
+
- lib/leankit/backlog.rb
|
79
|
+
- lib/leankit/board.rb
|
80
|
+
- lib/leankit/card.rb
|
81
|
+
- lib/leankit/config.rb
|
82
|
+
- lib/leankit/version.rb
|
76
83
|
- lib/leankit_request.rb
|
77
|
-
- lib/leankitkanban.rb
|
78
|
-
- lib/leankitkanban/archive.rb
|
79
|
-
- lib/leankitkanban/backlog.rb
|
80
|
-
- lib/leankitkanban/board.rb
|
81
|
-
- lib/leankitkanban/card.rb
|
82
|
-
- lib/leankitkanban/config.rb
|
83
|
-
- lib/leankitkanban/version.rb
|
84
84
|
files:
|
85
85
|
- Gemfile
|
86
86
|
- Gemfile.lock
|
@@ -89,19 +89,19 @@ files:
|
|
89
89
|
- README.md
|
90
90
|
- Rakefile
|
91
91
|
- leankit.gemspec
|
92
|
+
- lib/leankit.rb
|
93
|
+
- lib/leankit/archive.rb
|
94
|
+
- lib/leankit/backlog.rb
|
95
|
+
- lib/leankit/board.rb
|
96
|
+
- lib/leankit/card.rb
|
97
|
+
- lib/leankit/config.rb
|
98
|
+
- lib/leankit/version.rb
|
92
99
|
- lib/leankit_request.rb
|
93
|
-
-
|
94
|
-
-
|
95
|
-
-
|
96
|
-
-
|
97
|
-
-
|
98
|
-
- lib/leankitkanban/config.rb
|
99
|
-
- lib/leankitkanban/version.rb
|
100
|
-
- spec/leankitkanban/archive_spec.rb
|
101
|
-
- spec/leankitkanban/backlog_spec.rb
|
102
|
-
- spec/leankitkanban/board_spec.rb
|
103
|
-
- spec/leankitkanban/card_spec.rb
|
104
|
-
- spec/leankitkanban/config_spec.rb
|
100
|
+
- spec/leankit/archive_spec.rb
|
101
|
+
- spec/leankit/backlog_spec.rb
|
102
|
+
- spec/leankit/board_spec.rb
|
103
|
+
- spec/leankit/card_spec.rb
|
104
|
+
- spec/leankit/config_spec.rb
|
105
105
|
- spec/spec_helper.rb
|
106
106
|
- spec/support/config_helper.rb
|
107
107
|
homepage: http://github.com/noahpryor/leankitkanban
|
data/lib/leankitkanban.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require "uri"
|
2
|
-
require "httparty"
|
3
|
-
require "json"
|
4
|
-
|
5
|
-
require File.join(File.dirname(__FILE__), 'leankit_request')
|
6
|
-
require File.join(File.dirname(__FILE__), 'leankitkanban', 'config')
|
7
|
-
require File.join(File.dirname(__FILE__), 'leankitkanban', 'board')
|
8
|
-
require File.join(File.dirname(__FILE__), 'leankitkanban', 'card')
|
9
|
-
require File.join(File.dirname(__FILE__), 'leankitkanban', 'backlog')
|
10
|
-
require File.join(File.dirname(__FILE__), 'leankitkanban', 'archive')
|
11
|
-
|
12
|
-
module LeanKitKanban
|
13
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe LeanKitKanban::Config do
|
4
|
-
describe :validate do
|
5
|
-
before :each do
|
6
|
-
ConfigHelper.set_test_config
|
7
|
-
end
|
8
|
-
|
9
|
-
context "when the config is not set" do
|
10
|
-
it "raises a no credentials error when no email" do
|
11
|
-
LeanKitKanban::Config.email = nil
|
12
|
-
lambda{ LeanKitKanban::Config.validate }.should raise_error(LeanKitKanban::Config::NoCredentials)
|
13
|
-
end
|
14
|
-
|
15
|
-
it "raises a no credentials error when no password" do
|
16
|
-
LeanKitKanban::Config.password = nil
|
17
|
-
lambda{ LeanKitKanban::Config.validate }.should raise_error(LeanKitKanban::Config::NoCredentials)
|
18
|
-
end
|
19
|
-
|
20
|
-
it "raises a no account error when no account" do
|
21
|
-
LeanKitKanban::Config.account = nil
|
22
|
-
lambda{ LeanKitKanban::Config.validate }.should raise_error(LeanKitKanban::Config::NoAccount)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context "when the config is set" do
|
27
|
-
it "doesn't raise a no credentials error" do
|
28
|
-
lambda{ LeanKitKanban::Config.validate }.should_not raise_error(LeanKitKanban::Config::NoCredentials)
|
29
|
-
end
|
30
|
-
|
31
|
-
it "doesn't raise a no account error" do
|
32
|
-
lambda{ LeanKitKanban::Config.validate }.should_not raise_error(LeanKitKanban::Config::NoAccount)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
describe :uri do
|
38
|
-
it "validates the config" do
|
39
|
-
LeanKitKanban::Config.should_receive(:validate)
|
40
|
-
LeanKitKanban::Config.uri
|
41
|
-
end
|
42
|
-
|
43
|
-
it "returns the domain including the account name" do
|
44
|
-
LeanKitKanban::Config.uri.should eql "http://#{TEST_ACCOUNT}.leankitkanban.com/Kanban/API"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
describe :basic_auth_hash do
|
49
|
-
it "validates the config" do
|
50
|
-
LeanKitKanban::Config.should_receive(:validate)
|
51
|
-
LeanKitKanban::Config.basic_auth_hash
|
52
|
-
end
|
53
|
-
|
54
|
-
it "returns a hash with the credentials" do
|
55
|
-
expected_hash = {:basic_auth => {:username => EMAIL, :password => PASSWORD}}
|
56
|
-
LeanKitKanban::Config.basic_auth_hash.should eql expected_hash
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|