troo 0.0.14 → 0.0.15

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc2cc51307a49287d28d92a71db4c8655328f7b2
4
- data.tar.gz: 70f29bfe2891c56177bf113a4d9676fddcd02d63
3
+ metadata.gz: 0b057bb80ac424df1b422d7555fc9244757cdb8b
4
+ data.tar.gz: 19281bd89f168e98be9ef8127fd17ad097f05c1c
5
5
  SHA512:
6
- metadata.gz: bea88ff8f5717561581c8d4eadb792328e2901e4282583c301c1e791aed7b053c933c0c1df6e98f6e813cf6a23072280b00ba2bb5f79a0a0f5b6a28c3ce22b7b
7
- data.tar.gz: 849ffb4ddd66b6458becc00d6cb1e8e8cd7197e2de4aa4195191bb2e6e12bb92940c73d5ea2d6f922b8c71d7af71fb7b4da6ee09d82c93782ec2dfd5c046e850
6
+ metadata.gz: cf8ceb66051a4eb4135af45ec1c6e610a0e958424afaa2c0fc71d9a3a0d9cf4c5fcf6dc983c73616b40a6a60cdabce0ebbecf8ac0c8a2f3a9b82cbdc4ebfbc28
7
+ data.tar.gz: 8865e6eb700286ff57e5411294a2692c8da13b85d9842d1d42c32ce8881c1236f0b8ebd48bc59de26a8c545de329065d9b5acd1cf82e6ba8ec0855fb5468f175
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- troo (0.0.14)
4
+ troo (0.0.15)
5
5
  addressable
6
6
  curses (= 1.0.1)
7
7
  dispel
@@ -128,7 +128,7 @@ module Troo
128
128
  end
129
129
 
130
130
  def filename
131
- filename = [Troo.root_path + '/tmp/', endpoint.to_s]
131
+ filename = [Troo.root_path + '/logs/api/', endpoint.to_s]
132
132
  filename << '_' << external_id if external_id
133
133
  filename << '.json'
134
134
  filename.join
@@ -51,7 +51,7 @@ module Troo
51
51
  [:lists, :cards, :members]
52
52
  end
53
53
 
54
- # @return []
54
+ # @return [Class]
55
55
  def local_model
56
56
  Troo::Board
57
57
  end
@@ -62,7 +62,7 @@ module Troo
62
62
  [:actions]
63
63
  end
64
64
 
65
- # @return []
65
+ # @return [Class]
66
66
  def local_model
67
67
  Troo::Card
68
68
  end
@@ -34,22 +34,22 @@ module Troo
34
34
  end
35
35
  end
36
36
 
37
- # @return []
37
+ # @return [String]
38
38
  def external_board_id
39
39
  data.board.id
40
40
  end
41
41
 
42
- # @return []
42
+ # @return [String]
43
43
  def external_card_id
44
44
  data.card.id
45
45
  end
46
46
 
47
- # @return []
47
+ # @return [String]
48
48
  def external_comment_id
49
49
  id
50
50
  end
51
51
 
52
- # @return []
52
+ # @return [String]
53
53
  def text
54
54
  data.text
55
55
  end
@@ -59,7 +59,7 @@ module Troo
59
59
  [:memberCreator]
60
60
  end
61
61
 
62
- # @return []
62
+ # @return [Class]
63
63
  def local_model
64
64
  Troo::Comment
65
65
  end
@@ -35,7 +35,7 @@ module Troo
35
35
  []
36
36
  end
37
37
 
38
- # @return [Troo::List]
38
+ # @return [Class]
39
39
  def local_model
40
40
  Troo::List
41
41
  end
@@ -58,7 +58,7 @@ module Troo
58
58
  []
59
59
  end
60
60
 
61
- # @return [Troo::Member]
61
+ # @return [Class]
62
62
  def local_model
63
63
  Troo::Member
64
64
  end
@@ -1,3 +1,3 @@
1
1
  module Troo
2
- VERSION = '0.0.14'
2
+ VERSION = '0.0.15'
3
3
  end
File without changes
@@ -13,6 +13,8 @@ module Troo
13
13
  describe '.remote_options' do
14
14
  subject { described_class.remote_options }
15
15
 
16
+ it { subject.must_be_instance_of(Hash) }
17
+
16
18
  it 'returns the default remote options' do
17
19
  subject.fetch(:mode).must_equal(:board)
18
20
  end
@@ -21,6 +23,8 @@ module Troo
21
23
  describe '.all' do
22
24
  subject { described_class.all }
23
25
 
26
+ it { subject.must_be_instance_of(Hash) }
27
+
24
28
  it 'returns the resource parameters' do
25
29
  subject.fetch(:endpoint).must_equal(:boards_all)
26
30
  end
@@ -29,6 +33,8 @@ module Troo
29
33
  describe '.by_board_id' do
30
34
  subject { described_class.by_board_id }
31
35
 
36
+ it { subject.must_be_instance_of(Hash) }
37
+
32
38
  it 'returns the resource parameters' do
33
39
  subject.fetch(:endpoint).must_equal(:board_by_id)
34
40
  end
@@ -37,18 +43,24 @@ module Troo
37
43
  describe '#associations' do
38
44
  subject { described_instance.associations }
39
45
 
46
+ it { subject.must_be_instance_of(Array) }
47
+
40
48
  it { subject.must_equal [:lists, :cards, :members] }
41
49
  end
42
50
 
43
51
  describe '#local_model' do
44
52
  subject { described_instance.local_model }
45
53
 
54
+ it { subject.must_be_instance_of(Class) }
55
+
46
56
  it { subject.must_equal Troo::Board }
47
57
  end
48
58
 
49
59
  describe '#adapted' do
50
60
  subject { described_instance.adapted }
51
61
 
62
+ it { subject.must_be_instance_of(Hash) }
63
+
52
64
  it 'returns an adapted resource for local persistence' do
53
65
  subject.must_equal(
54
66
  external_id: '20010',
@@ -12,6 +12,8 @@ module Troo
12
12
  describe '.remote_options' do
13
13
  subject { described_class.remote_options }
14
14
 
15
+ it { subject.must_be_instance_of(Hash) }
16
+
15
17
  it 'returns the default remote options' do
16
18
  subject.fetch(:mode).must_equal(:card)
17
19
  end
@@ -20,6 +22,8 @@ module Troo
20
22
  describe '.by_board_id' do
21
23
  subject { described_class.by_board_id }
22
24
 
25
+ it { subject.must_be_instance_of(Hash) }
26
+
23
27
  it 'returns the resource parameters' do
24
28
  subject.fetch(:endpoint).must_equal(:cards_by_board_id)
25
29
  end
@@ -28,6 +32,8 @@ module Troo
28
32
  describe '.by_list_id' do
29
33
  subject { described_class.by_list_id }
30
34
 
35
+ it { subject.must_be_instance_of(Hash) }
36
+
31
37
  it 'returns the resource parameters' do
32
38
  subject.fetch(:endpoint).must_equal(:cards_by_list_id)
33
39
  end
@@ -36,6 +42,8 @@ module Troo
36
42
  describe '.by_card_id' do
37
43
  subject { described_class.by_card_id }
38
44
 
45
+ it { subject.must_be_instance_of(Hash) }
46
+
39
47
  it 'returns the resource parameters' do
40
48
  subject.fetch(:endpoint).must_equal(:card_by_id)
41
49
  end
@@ -44,18 +52,24 @@ module Troo
44
52
  describe '#associations' do
45
53
  subject { described_instance.associations }
46
54
 
55
+ it { subject.must_be_instance_of(Array) }
56
+
47
57
  it { subject.must_equal [:actions] }
48
58
  end
49
59
 
50
60
  describe '#local_model' do
51
61
  subject { described_instance.local_model }
52
62
 
63
+ it { subject.must_be_instance_of(Class) }
64
+
53
65
  it { subject.must_equal Troo::Card }
54
66
  end
55
67
 
56
68
  describe '#adapted' do
57
69
  subject { described_instance.adapted }
58
70
 
71
+ it { subject.must_be_instance_of(Hash) }
72
+
59
73
  it 'returns an adapted resource for local persistence' do
60
74
  subject.must_equal(
61
75
  external_board_id: '20010',
@@ -4,6 +4,18 @@ module Troo
4
4
  module Remote
5
5
  describe CommentDataBoard do
6
6
  let(:described_class) { CommentDataBoard }
7
+ let(:resource) {
8
+ {
9
+ shortLink: '',
10
+ name: '',
11
+ id: ''
12
+ }
13
+ }
14
+ let(:described_instance) { described_class.new(resource) }
15
+
16
+ subject { described_instance }
17
+
18
+ it { subject.must_be_instance_of(Troo::Remote::CommentDataBoard) }
7
19
  end
8
20
  end
9
21
  end
@@ -3,7 +3,20 @@ require_relative '../../../test_helper'
3
3
  module Troo
4
4
  module Remote
5
5
  describe CommentDataCard do
6
- let(:described_class) { CommentDataCard }
6
+ let(:described_class) { CommentDataCard }
7
+ let(:resource) {
8
+ {
9
+ shortLink: '',
10
+ idShort: '',
11
+ name: '',
12
+ id: ''
13
+ }
14
+ }
15
+ let(:described_instance) { described_class.new(resource) }
16
+
17
+ subject { described_instance }
18
+
19
+ it { subject.must_be_instance_of(Troo::Remote::CommentDataCard) }
7
20
  end
8
21
  end
9
22
  end
@@ -3,7 +3,19 @@ require_relative '../../../test_helper'
3
3
  module Troo
4
4
  module Remote
5
5
  describe CommentData do
6
- let(:described_class) { CommentData }
6
+ let(:described_class) { CommentData }
7
+ let(:resource) {
8
+ {
9
+ board: {},
10
+ card: {},
11
+ text: ''
12
+ }
13
+ }
14
+ let(:described_instance) { described_class.new(resource) }
15
+
16
+ subject { described_instance }
17
+
18
+ it { subject.must_be_instance_of(Troo::Remote::CommentData) }
7
19
  end
8
20
  end
9
21
  end
@@ -12,6 +12,8 @@ module Troo
12
12
  describe '.remote_options' do
13
13
  subject { described_class.remote_options }
14
14
 
15
+ it { subject.must_be_instance_of(Hash) }
16
+
15
17
  it 'returns the default remote options' do
16
18
  subject.fetch(:mode).must_equal(:card)
17
19
  end
@@ -20,6 +22,8 @@ module Troo
20
22
  describe '.by_board_id' do
21
23
  subject { described_class.by_board_id }
22
24
 
25
+ it { subject.must_be_instance_of(Hash) }
26
+
23
27
  it 'returns the resource parameters' do
24
28
  subject.fetch(:endpoint).must_equal(:comments_by_board_id)
25
29
  end
@@ -28,6 +32,8 @@ module Troo
28
32
  describe '.by_card_id' do
29
33
  subject { described_class.by_card_id }
30
34
 
35
+ it { subject.must_be_instance_of(Hash) }
36
+
31
37
  it 'returns the resource parameters' do
32
38
  subject.fetch(:endpoint).must_equal(:comments_by_card_id)
33
39
  end
@@ -36,6 +42,8 @@ module Troo
36
42
  describe '#external_board_id' do
37
43
  subject { described_instance.external_board_id }
38
44
 
45
+ it { subject.must_be_instance_of(String) }
46
+
39
47
  it 'delegates to the CommentData model' do
40
48
  subject.must_equal('20010')
41
49
  end
@@ -44,6 +52,8 @@ module Troo
44
52
  describe '#external_card_id' do
45
53
  subject { described_instance.external_card_id }
46
54
 
55
+ it { subject.must_be_instance_of(String) }
56
+
47
57
  it 'delegates to the CommentData model' do
48
58
  subject.must_equal('20020')
49
59
  end
@@ -52,6 +62,8 @@ module Troo
52
62
  describe '#external_comment_id' do
53
63
  subject { described_instance.external_comment_id }
54
64
 
65
+ it { subject.must_be_instance_of(String) }
66
+
55
67
  it 'returns the value of the id attribute' do
56
68
  subject.must_equal('20030')
57
69
  end
@@ -60,6 +72,8 @@ module Troo
60
72
  describe '#text' do
61
73
  subject { described_instance.text }
62
74
 
75
+ it { subject.must_be_instance_of(String) }
76
+
63
77
  it 'delegates to the CommentData model' do
64
78
  subject.must_equal('My Test Comment')
65
79
  end
@@ -68,18 +82,24 @@ module Troo
68
82
  describe '#associations' do
69
83
  subject { described_instance.associations }
70
84
 
85
+ it { subject.must_be_instance_of(Array) }
86
+
71
87
  it { subject.must_equal [:memberCreator] }
72
88
  end
73
89
 
74
90
  describe '#local_model' do
75
91
  subject { described_instance.local_model }
76
92
 
93
+ it { subject.must_be_instance_of(Class) }
94
+
77
95
  it { subject.must_equal Troo::Comment }
78
96
  end
79
97
 
80
98
  describe '#adapted' do
81
99
  subject { described_instance.adapted }
82
100
 
101
+ it { subject.must_be_instance_of(Hash) }
102
+
83
103
  it 'returns an adapted resource for local persistence' do
84
104
  subject.must_equal(
85
105
  external_id: '20030',
@@ -12,6 +12,8 @@ module Troo
12
12
  describe '.remote_options' do
13
13
  subject { described_class.remote_options }
14
14
 
15
+ it { subject.must_be_instance_of(Hash) }
16
+
15
17
  it 'returns the default remote options' do
16
18
  subject.fetch(:mode).must_equal(:list)
17
19
  end
@@ -20,6 +22,8 @@ module Troo
20
22
  describe '.by_board_id' do
21
23
  subject { described_class.by_board_id }
22
24
 
25
+ it { subject.must_be_instance_of(Hash) }
26
+
23
27
  it 'returns the resource parameters' do
24
28
  subject.fetch(:endpoint).must_equal(:lists_by_board_id)
25
29
  end
@@ -28,6 +32,8 @@ module Troo
28
32
  describe '.by_list_id' do
29
33
  subject { described_class.by_list_id }
30
34
 
35
+ it { subject.must_be_instance_of(Hash) }
36
+
31
37
  it 'returns the resource parameters' do
32
38
  subject.fetch(:endpoint).must_equal(:list_by_id)
33
39
  end
@@ -36,18 +42,24 @@ module Troo
36
42
  describe '#associations' do
37
43
  subject { described_instance.associations }
38
44
 
45
+ it { subject.must_be_instance_of(Array) }
46
+
39
47
  it { subject.must_equal [] }
40
48
  end
41
49
 
42
50
  describe '#local_model' do
43
51
  subject { described_instance.local_model }
44
52
 
53
+ it { subject.must_be_instance_of(Class) }
54
+
45
55
  it { subject.must_equal Troo::List }
46
56
  end
47
57
 
48
58
  describe '#adapted' do
49
59
  subject { described_instance.adapted }
50
60
 
61
+ it { subject.must_be_instance_of(Hash) }
62
+
51
63
  it 'returns an adapted resource for local persistence' do
52
64
  subject.must_equal(
53
65
  external_board_id: '20010',
@@ -12,6 +12,8 @@ module Troo
12
12
  describe '.remote_options' do
13
13
  subject { described_class.remote_options }
14
14
 
15
+ it { subject.must_be_instance_of(Hash) }
16
+
15
17
  it 'returns the default remote options' do
16
18
  subject.fetch(:mode).must_equal(:member)
17
19
  end
@@ -20,6 +22,8 @@ module Troo
20
22
  describe '.by_board_id' do
21
23
  subject { described_class.by_board_id }
22
24
 
25
+ it { subject.must_be_instance_of(Hash) }
26
+
23
27
  it 'returns the resource parameters' do
24
28
  subject.fetch(:endpoint).must_equal(:members_by_board_id)
25
29
  end
@@ -28,6 +32,8 @@ module Troo
28
32
  describe '.by_member_id' do
29
33
  subject { described_class.by_member_id }
30
34
 
35
+ it { subject.must_be_instance_of(Hash) }
36
+
31
37
  it 'returns the resource parameters' do
32
38
  subject.fetch(:endpoint).must_equal(:member_by_id)
33
39
  end
@@ -36,18 +42,24 @@ module Troo
36
42
  describe '#associations' do
37
43
  subject { described_instance.associations }
38
44
 
45
+ it { subject.must_be_instance_of(Array) }
46
+
39
47
  it { subject.must_equal [] }
40
48
  end
41
49
 
42
50
  describe '#local_model' do
43
51
  subject { described_instance.local_model }
44
52
 
53
+ it { subject.must_be_instance_of(Class) }
54
+
45
55
  it { subject.must_equal Troo::Member }
46
56
  end
47
57
 
48
58
  describe '#adapted' do
49
59
  subject { described_instance.adapted }
50
60
 
61
+ it { subject.must_be_instance_of(Hash) }
62
+
51
63
  it 'returns an adapted resource for local persistence' do
52
64
  subject.must_equal(
53
65
  external_id: '20050',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: troo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Laking
@@ -601,6 +601,7 @@ files:
601
601
  - lib/troo/views/card.erb
602
602
  - lib/troo/views/comments.erb
603
603
  - logs/.gitkeep
604
+ - logs/api/.gitkeep
604
605
  - test/cassettes/create_board.yml
605
606
  - test/cassettes/create_card.yml
606
607
  - test/cassettes/create_comment.yml