leantesting 1.0.1 → 1.0.2
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 +4 -4
- data/README.md +2 -2
- data/leantesting.gemspec +1 -1
- data/lib/BaseClass/APIRequest.rb +154 -151
- data/lib/BaseClass/Entity.rb +25 -24
- data/lib/BaseClass/EntityHandler.rb +151 -149
- data/lib/BaseClass/EntityList.rb +163 -161
- data/lib/Entity/Bug/Bug.rb +10 -8
- data/lib/Entity/Bug/BugAttachment.rb +7 -5
- data/lib/Entity/Bug/BugComment.rb +7 -5
- data/lib/Entity/Platform/PlatformBrowser.rb +9 -7
- data/lib/Entity/Platform/PlatformBrowserVersion.rb +7 -5
- data/lib/Entity/Platform/PlatformDevice.rb +7 -5
- data/lib/Entity/Platform/PlatformOS.rb +9 -7
- data/lib/Entity/Platform/PlatformOSVersion.rb +7 -5
- data/lib/Entity/Platform/PlatformType.rb +9 -7
- data/lib/Entity/Project/Project.rb +24 -22
- data/lib/Entity/Project/ProjectBugScheme.rb +7 -5
- data/lib/Entity/Project/ProjectSection.rb +7 -5
- data/lib/Entity/Project/ProjectUser.rb +7 -5
- data/lib/Entity/Project/ProjectVersion.rb +7 -5
- data/lib/Entity/User/UserOrganization.rb +7 -5
- data/lib/Exception/BaseException/SDKException.rb +15 -13
- data/lib/Exception/SDKBadJSONResponseException.rb +13 -11
- data/lib/Exception/SDKDuplicateRequestException.rb +15 -13
- data/lib/Exception/SDKErrorResponseException.rb +12 -10
- data/lib/Exception/SDKIncompleteRequestException.rb +15 -13
- data/lib/Exception/SDKInvalidArgException.rb +13 -11
- data/lib/Exception/SDKMissingArgException.rb +13 -11
- data/lib/Exception/SDKUnexpectedResponseException.rb +13 -11
- data/lib/Exception/SDKUnsupportedRequestException.rb +15 -13
- data/lib/Handler/Attachment/AttachmentsHandler.rb +14 -12
- data/lib/Handler/Auth/OAuth2Handler.rb +102 -100
- data/lib/Handler/Bug/BugAttachmentsHandler.rb +44 -42
- data/lib/Handler/Bug/BugCommentsHandler.rb +16 -14
- data/lib/Handler/Bug/BugsHandler.rb +53 -51
- data/lib/Handler/Platform/PlatformBrowserVersionsHandler.rb +16 -14
- data/lib/Handler/Platform/PlatformBrowsersHandler.rb +18 -16
- data/lib/Handler/Platform/PlatformDevicesHandler.rb +9 -7
- data/lib/Handler/Platform/PlatformHandler.rb +20 -18
- data/lib/Handler/Platform/PlatformOSHandler.rb +18 -16
- data/lib/Handler/Platform/PlatformOSVersionsHandler.rb +16 -14
- data/lib/Handler/Platform/PlatformTypeDevicesHandler.rb +16 -14
- data/lib/Handler/Platform/PlatformTypesHandler.rb +17 -15
- data/lib/Handler/Project/ProjectBugReproducibilitySchemeHandler.rb +16 -14
- data/lib/Handler/Project/ProjectBugSeveritySchemeHandler.rb +16 -14
- data/lib/Handler/Project/ProjectBugStatusSchemeHandler.rb +16 -14
- data/lib/Handler/Project/ProjectBugTypeSchemeHandler.rb +16 -14
- data/lib/Handler/Project/ProjectBugsHandler.rb +55 -53
- data/lib/Handler/Project/ProjectSectionsHandler.rb +30 -28
- data/lib/Handler/Project/ProjectUsersHandler.rb +16 -14
- data/lib/Handler/Project/ProjectVersionsHandler.rb +30 -28
- data/lib/Handler/Project/ProjectsHandler.rb +34 -32
- data/lib/Handler/User/UserHandler.rb +12 -10
- data/lib/Handler/User/UserOrganizationsHandler.rb +12 -10
- data/tests/APIRequestTest.rb +33 -33
- data/tests/BaseClassesTest.rb +28 -28
- data/tests/ClientTest.rb +7 -7
- data/tests/EntitiesTest.rb +31 -31
- data/tests/EntityListTest.rb +13 -13
- data/tests/ExceptionsTest.rb +15 -15
- data/tests/HandlersRequestsTest.rb +37 -37
- data/tests/MockRequestsTest.rb +48 -48
- data/tests/OAuth2HandlerTest.rb +19 -19
- metadata +2 -1
@@ -1,10 +1,12 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
module LeanTesting
|
2
|
+
class PlatformOS < LeanTesting::Entity
|
3
|
+
attr_reader :versions
|
3
4
|
|
4
|
-
|
5
|
-
|
5
|
+
def initialize(origin, data)
|
6
|
+
super
|
6
7
|
|
7
|
-
|
8
|
-
|
8
|
+
@versions = PlatformOSVersionsHandler.new(origin, data['id'])
|
9
|
+
end
|
9
10
|
|
10
|
-
end
|
11
|
+
end
|
12
|
+
end
|
@@ -1,10 +1,12 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
module LeanTesting
|
2
|
+
class PlatformType < LeanTesting::Entity
|
3
|
+
attr_reader :devices
|
3
4
|
|
4
|
-
|
5
|
-
|
5
|
+
def initialize(origin, data)
|
6
|
+
super
|
6
7
|
|
7
|
-
|
8
|
-
|
8
|
+
@devices = PlatformTypeDevicesHandler.new(origin, data['id'])
|
9
|
+
end
|
9
10
|
|
10
|
-
end
|
11
|
+
end
|
12
|
+
end
|
@@ -1,27 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
module LeanTesting
|
2
|
+
class Project < LeanTesting::Entity
|
3
|
+
attr_reader \
|
4
|
+
:sections,
|
5
|
+
:versions,
|
6
|
+
:users,
|
7
|
+
:bugTypeScheme,
|
8
|
+
:bugStatusScheme,
|
9
|
+
:bugSeverityScheme,
|
10
|
+
:bugReproducibilityScheme,
|
11
|
+
:bugs
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
def initialize(origin, data)
|
14
|
+
super
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
@sections = ProjectSectionsHandler.new(origin, data['id'])
|
17
|
+
@versions = ProjectVersionsHandler.new(origin, data['id'])
|
18
|
+
@users = ProjectUsersHandler.new(origin, data['id'])
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
@bugTypeScheme = ProjectBugTypeSchemeHandler.new(origin, data['id'])
|
21
|
+
@bugStatusScheme = ProjectBugStatusSchemeHandler.new(origin, data['id'])
|
22
|
+
@bugSeverityScheme = ProjectBugSeveritySchemeHandler.new(origin, data['id'])
|
23
|
+
@bugReproducibilityScheme = ProjectBugReproducibilitySchemeHandler.new(origin, data['id'])
|
23
24
|
|
24
|
-
|
25
|
-
|
25
|
+
@bugs = ProjectBugsHandler.new(origin, data['id'])
|
26
|
+
end
|
26
27
|
|
27
|
-
end
|
28
|
+
end
|
29
|
+
end
|
@@ -1,19 +1,21 @@
|
|
1
|
-
|
1
|
+
module LeanTesting
|
2
|
+
class SDKException < Exception
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
def initialize(message = nil)
|
5
|
+
super
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
if !message
|
8
|
+
message = 'Unknown SDK Error'
|
9
|
+
else
|
10
|
+
message = 'SDK Error: ' + message
|
11
|
+
end
|
12
|
+
|
13
|
+
@message = message
|
10
14
|
end
|
11
15
|
|
12
|
-
|
13
|
-
|
16
|
+
def message
|
17
|
+
@message
|
18
|
+
end
|
14
19
|
|
15
|
-
def message
|
16
|
-
@message
|
17
20
|
end
|
18
|
-
|
19
|
-
end
|
21
|
+
end
|
@@ -1,15 +1,17 @@
|
|
1
|
-
|
1
|
+
module LeanTesting
|
2
|
+
class SDKBadJSONResponseException < SDKException
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
def initialize(message = nil)
|
5
|
+
@baseMessage = 'JSON remote response is inconsistent or invalid'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
if !message
|
8
|
+
message = @baseMessage
|
9
|
+
else
|
10
|
+
message = @baseMessage + ' - ' + message
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
super
|
14
|
+
end
|
14
15
|
|
15
|
-
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,19 +1,21 @@
|
|
1
|
-
|
1
|
+
module LeanTesting
|
2
|
+
class SDKDuplicateRequestException < SDKException
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
def initialize(message = nil)
|
5
|
+
@baseMessage = 'Duplicate request data'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
if message.is_a? Array
|
8
|
+
message = message.map{ |el| '`' + el + '`' }.join(', ')
|
9
|
+
end
|
10
|
+
|
11
|
+
if !message
|
12
|
+
message = @baseMessage
|
13
|
+
else
|
14
|
+
message = @baseMessage + ' - multiple ' + message
|
15
|
+
end
|
9
16
|
|
10
|
-
|
11
|
-
message = @baseMessage
|
12
|
-
else
|
13
|
-
message = @baseMessage + ' - multiple ' + message
|
17
|
+
super
|
14
18
|
end
|
15
19
|
|
16
|
-
super
|
17
20
|
end
|
18
|
-
|
19
|
-
end
|
21
|
+
end
|
@@ -1,13 +1,15 @@
|
|
1
|
-
|
1
|
+
module LeanTesting
|
2
|
+
class SDKErrorResponseException < SDKException
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
def initialize(message = nil)
|
5
|
+
if !message
|
6
|
+
message = 'Unknown remote error'
|
7
|
+
else
|
8
|
+
message = 'Got error response: ' + message
|
9
|
+
end
|
9
10
|
|
10
|
-
|
11
|
-
|
11
|
+
super
|
12
|
+
end
|
12
13
|
|
13
|
-
end
|
14
|
+
end
|
15
|
+
end
|
@@ -1,19 +1,21 @@
|
|
1
|
-
|
1
|
+
module LeanTesting
|
2
|
+
class SDKIncompleteRequestException < SDKException
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
def initialize(message = nil)
|
5
|
+
@baseMessage = 'Incomplete request data'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
if message.is_a? Array
|
8
|
+
message = message.map{ |el| '`' + el + '`' }.join(', ')
|
9
|
+
end
|
10
|
+
|
11
|
+
if !message
|
12
|
+
message = @baseMessage
|
13
|
+
else
|
14
|
+
message = @baseMessage + ' - missing required ' + message
|
15
|
+
end
|
9
16
|
|
10
|
-
|
11
|
-
message = @baseMessage
|
12
|
-
else
|
13
|
-
message = @baseMessage + ' - missing required ' + message
|
17
|
+
super
|
14
18
|
end
|
15
19
|
|
16
|
-
super
|
17
20
|
end
|
18
|
-
|
19
|
-
end
|
21
|
+
end
|
@@ -1,15 +1,17 @@
|
|
1
|
-
|
1
|
+
module LeanTesting
|
2
|
+
class SDKInvalidArgException < SDKException
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
def initialize(message = nil)
|
5
|
+
@baseMessage = 'Invalid argument'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
if !message
|
8
|
+
message = @baseMessage
|
9
|
+
else
|
10
|
+
message = @baseMessage + ': ' + message
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
super
|
14
|
+
end
|
14
15
|
|
15
|
-
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,15 +1,17 @@
|
|
1
|
-
|
1
|
+
module LeanTesting
|
2
|
+
class SDKMissingArgException < SDKException
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
def initialize(message = nil)
|
5
|
+
@baseMessage = 'Missing argument'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
if !message
|
8
|
+
message = @baseMessage
|
9
|
+
else
|
10
|
+
message = @baseMessage + ' `' + message + '`'
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
super
|
14
|
+
end
|
14
15
|
|
15
|
-
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,15 +1,17 @@
|
|
1
|
-
|
1
|
+
module LeanTesting
|
2
|
+
class SDKUnexpectedResponseException < SDKException
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
def initialize(message = nil)
|
5
|
+
@baseMessage = 'Got unexpected remote response'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
if !message
|
8
|
+
message = @baseMessage
|
9
|
+
else
|
10
|
+
message = @baseMessage + ' - ' + message
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
super
|
14
|
+
end
|
14
15
|
|
15
|
-
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,19 +1,21 @@
|
|
1
|
-
|
1
|
+
module LeanTesting
|
2
|
+
class SDKUnsupportedRequestException < SDKException
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
def initialize(message = nil)
|
5
|
+
@baseMessage = 'Unsupported request data'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
if message.is_a? Array
|
8
|
+
message = message.map{ |el| '`' + el + '`' }.join(', ')
|
9
|
+
end
|
10
|
+
|
11
|
+
if !message
|
12
|
+
message = @baseMessage
|
13
|
+
else
|
14
|
+
message = @baseMessage + ' - invalid ' + message
|
15
|
+
end
|
9
16
|
|
10
|
-
|
11
|
-
message = @baseMessage
|
12
|
-
else
|
13
|
-
message = @baseMessage + ' - invalid ' + message
|
17
|
+
super
|
14
18
|
end
|
15
19
|
|
16
|
-
super
|
17
20
|
end
|
18
|
-
|
19
|
-
end
|
21
|
+
end
|