freeclimb 4.4.0 → 4.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -2
  3. data/Gemfile.lock +1 -1
  4. data/README.md +4 -4
  5. data/docs/AddToConference.md +1 -1
  6. data/docs/AddToConferenceAllOf.md +1 -1
  7. data/lib/freeclimb/models/add_to_conference.rb +1 -1
  8. data/lib/freeclimb/models/add_to_conference_all_of.rb +1 -1
  9. data/lib/freeclimb/version.rb +1 -1
  10. data/openapi.json +161 -60
  11. data/spec/models/account_request_spec.rb +143 -2
  12. data/spec/models/account_result_spec.rb +377 -13
  13. data/spec/models/account_status_spec.rb +39 -6
  14. data/spec/models/account_type_spec.rb +26 -4
  15. data/spec/models/add_to_conference_spec.rb +343 -10
  16. data/spec/models/answered_by_spec.rb +26 -4
  17. data/spec/models/application_list_spec.rb +293 -8
  18. data/spec/models/application_request_spec.rb +268 -7
  19. data/spec/models/application_result_spec.rb +418 -13
  20. data/spec/models/available_number_list_spec.rb +293 -8
  21. data/spec/models/available_number_spec.rb +263 -7
  22. data/spec/models/buy_incoming_number_request_spec.rb +168 -3
  23. data/spec/models/call_direction_spec.rb +39 -6
  24. data/spec/models/call_list_spec.rb +293 -8
  25. data/spec/models/call_result_spec.rb +603 -22
  26. data/spec/models/call_status_spec.rb +104 -16
  27. data/spec/models/capabilities_spec.rb +218 -5
  28. data/spec/models/conference_list_spec.rb +293 -8
  29. data/spec/models/conference_participant_list_spec.rb +293 -8
  30. data/spec/models/conference_participant_result_spec.rb +343 -10
  31. data/spec/models/conference_result_spec.rb +464 -16
  32. data/spec/models/conference_status_spec.rb +52 -8
  33. data/spec/models/create_conference_request_spec.rb +228 -6
  34. data/spec/models/create_conference_spec.rb +253 -7
  35. data/spec/models/enqueue_spec.rb +193 -4
  36. data/spec/models/filter_logs_request_spec.rb +118 -1
  37. data/spec/models/get_digits_spec.rb +318 -9
  38. data/spec/models/get_speech_reason_spec.rb +78 -12
  39. data/spec/models/get_speech_spec.rb +388 -14
  40. data/spec/models/grammar_file_built_in_spec.rb +195 -30
  41. data/spec/models/grammar_type_spec.rb +26 -4
  42. data/spec/models/hangup_spec.rb +118 -1
  43. data/spec/models/if_machine_spec.rb +26 -4
  44. data/spec/models/incoming_number_list_spec.rb +293 -8
  45. data/spec/models/incoming_number_request_spec.rb +173 -2
  46. data/spec/models/incoming_number_result_spec.rb +488 -16
  47. data/spec/models/language_spec.rb +338 -52
  48. data/spec/models/log_level_spec.rb +39 -6
  49. data/spec/models/log_list_spec.rb +293 -8
  50. data/spec/models/log_result_spec.rb +275 -8
  51. data/spec/models/machine_type_spec.rb +26 -4
  52. data/spec/models/make_call_request_spec.rb +343 -10
  53. data/spec/models/message_direction_spec.rb +26 -4
  54. data/spec/models/message_request_spec.rb +318 -9
  55. data/spec/models/message_result_spec.rb +431 -13
  56. data/spec/models/message_status_spec.rb +143 -22
  57. data/spec/models/messages_list_spec.rb +293 -8
  58. data/spec/models/mutable_resource_model_spec.rb +193 -4
  59. data/spec/models/out_dial_spec.rb +345 -11
  60. data/spec/models/pagination_model_spec.rb +268 -7
  61. data/spec/models/park_spec.rb +168 -3
  62. data/spec/models/pause_spec.rb +118 -1
  63. data/spec/models/percl_command_spec.rb +132 -3
  64. data/spec/models/percl_script_spec.rb +118 -1
  65. data/spec/models/play_beep_spec.rb +52 -8
  66. data/spec/models/play_early_media_spec.rb +118 -1
  67. data/spec/models/play_spec.rb +193 -4
  68. data/spec/models/queue_list_spec.rb +293 -8
  69. data/spec/models/queue_member_list_spec.rb +293 -8
  70. data/spec/models/queue_member_spec.rb +218 -5
  71. data/spec/models/queue_request_spec.rb +143 -2
  72. data/spec/models/queue_result_spec.rb +369 -11
  73. data/spec/models/queue_result_status_spec.rb +52 -8
  74. data/spec/models/record_utterance_spec.rb +268 -7
  75. data/spec/models/record_utterance_term_reason_spec.rb +52 -8
  76. data/spec/models/recording_list_spec.rb +293 -8
  77. data/spec/models/recording_result_spec.rb +318 -9
  78. data/spec/models/redirect_spec.rb +118 -1
  79. data/spec/models/reject_spec.rb +118 -1
  80. data/spec/models/remove_from_conference_spec.rb +118 -1
  81. data/spec/models/request_type_spec.rb +299 -46
  82. data/spec/models/say_spec.rb +218 -5
  83. data/spec/models/send_digits_spec.rb +168 -3
  84. data/spec/models/set_listen_spec.rb +143 -2
  85. data/spec/models/set_talk_spec.rb +143 -2
  86. data/spec/models/sms_spec.rb +193 -4
  87. data/spec/models/sms_ten_dlc_brand_spec.rb +1070 -64
  88. data/spec/models/sms_ten_dlc_brands_list_result_spec.rb +294 -9
  89. data/spec/models/sms_ten_dlc_campaign_spec.rb +875 -38
  90. data/spec/models/sms_ten_dlc_campaigns_list_result_spec.rb +294 -9
  91. data/spec/models/sms_ten_dlc_partner_campaign_brand_spec.rb +365 -11
  92. data/spec/models/sms_ten_dlc_partner_campaign_spec.rb +823 -35
  93. data/spec/models/sms_ten_dlc_partner_campaigns_list_result_spec.rb +294 -9
  94. data/spec/models/terminate_conference_spec.rb +118 -1
  95. data/spec/models/update_call_request_spec.rb +120 -2
  96. data/spec/models/update_call_request_status_spec.rb +26 -4
  97. data/spec/models/update_conference_participant_request_spec.rb +143 -2
  98. data/spec/models/update_conference_request_spec.rb +180 -5
  99. data/spec/models/update_conference_request_status_spec.rb +26 -4
  100. metadata +77 -77
@@ -25,9 +25,138 @@ describe Freeclimb::PerclCommand do
25
25
  expect(instance).to be_instance_of(Freeclimb::PerclCommand)
26
26
  end
27
27
  end
28
- describe 'test attribute "command"' do
29
- it 'should work' do
30
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
28
+
29
+ describe 'test method "initialize"' do
30
+ it 'properly initializes with values' do
31
+ expect{instance = Freeclimb::PerclCommand.new(
32
+ command: "TS",
33
+ )}.not_to raise_error()
34
+ end
35
+ it 'fails to initialize with input argument that is not a hash in Freeclimb::PerclCommand' do
36
+ expect{instance = Freeclimb::PerclCommand.new(
37
+ command: "TS",
38
+ invalid_attribute: true
39
+ )}.to raise_error(ArgumentError)
40
+ end
41
+ it 'fails to initialize with invalid attribute' do
42
+ expect{instance = Freeclimb::PerclCommand.new(
43
+ command: "TS",
44
+ invalid_attribute: true
45
+ )}.to raise_error(ArgumentError)
46
+ end
47
+ end
48
+
49
+ describe 'test method "valid"' do
50
+ it 'checks if properties are valid' do
51
+ instance = Freeclimb::PerclCommand.new(
52
+ command: "TS",
53
+ )
54
+ expect(instance.valid?).to eq(true)
55
+ end
56
+ end
57
+
58
+ describe 'test method "eql?"' do
59
+ it 'checks if objects are equal' do
60
+ obj = Object.new()
61
+ instance_1 = Freeclimb::PerclCommand.new(
62
+ command: "TS",
63
+ )
64
+ instance_2 = Freeclimb::PerclCommand.new(
65
+ command: "TS",
66
+ )
67
+ expect(instance_1.eql?(instance_2)).to eq(true)
68
+ end
69
+ it 'checks if objects are not equal' do
70
+ instance_1 = Freeclimb::PerclCommand.new(
71
+ command: "TS",
72
+ )
73
+ instance_2 = Freeclimb::PerclCommand.new(
74
+ command: "ST",
75
+ )
76
+ expect(instance_1.eql?(instance_2)).to eq(false)
77
+ end
78
+ end
79
+
80
+ describe 'test method "hash"' do
81
+ it 'calculates hash code' do
82
+ instance = Freeclimb::PerclCommand.new(
83
+ command: "TS",
84
+ )
85
+ expect(instance.hash).to be_a_kind_of(Integer)
86
+ end
87
+ end
88
+
89
+ describe 'test method "build_from_hash"' do
90
+ it 'builds equivalent model from hash code' do
91
+ instance_1 = Freeclimb::PerclCommand.new(
92
+ command: "TS",
93
+ )
94
+ instance_2 = Freeclimb::PerclCommand.new
95
+ expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash))
96
+ end
97
+ end
98
+
99
+ describe 'test method "_deserialize"' do
100
+ instance = Freeclimb::PerclCommand.new(
101
+ command: "TS",
102
+ )
103
+ it 'deserializes the data of command' do
104
+ expect(instance._deserialize("String", instance.command)).to be_a_kind_of(String)
105
+ end
106
+ end
107
+
108
+ describe 'test method "to_s"' do
109
+ it 'returns the string representation of the object' do
110
+ instance = Freeclimb::PerclCommand.new(
111
+ command: "TS",
112
+ )
113
+ expect(instance.to_s).to eq(instance.to_hash.to_s)
114
+ end
115
+ end
116
+
117
+ describe 'test method "to_hash"' do
118
+ it 'returns the object in the form of hash' do
119
+ instance = Freeclimb::PerclCommand.new(
120
+ command: "TS",
121
+ )
122
+ expect(instance.to_hash).to be_a_kind_of(Hash)
123
+ end
124
+ it 'creates equal hash for two equal objects' do
125
+ obj = Object.new()
126
+ instance_1 = Freeclimb::PerclCommand.new(
127
+ command: "TS",
128
+ )
129
+ instance_2 = Freeclimb::PerclCommand.new(
130
+ command: "TS",
131
+ )
132
+ expect(instance_1.to_hash).to eq(instance_2.to_hash)
133
+ end
134
+ end
135
+
136
+ describe 'test method "_to_hash"' do
137
+ instance = Freeclimb::PerclCommand.new(
138
+ command: "TS",
139
+ )
140
+ it 'returns command in the form of hash' do
141
+ expect(instance._to_hash(instance.command)).to eq(instance.command)
142
+ end
143
+ end
144
+ describe 'test method "to_percl_hash"' do
145
+ it 'returns the object in the form of hash' do
146
+ instance = Freeclimb::PerclCommand.new(
147
+ command: "PERCL_COMMAND",
148
+ )
149
+ expect(instance.to_percl_hash).to be_a_kind_of(Hash)
150
+ end
151
+ it 'creates equal hash for two equal objects' do
152
+ obj = Object.new()
153
+ instance_1 = Freeclimb::PerclCommand.new(
154
+ command: "PERCL_COMMAND",
155
+ )
156
+ instance_2 = Freeclimb::PerclCommand.new(
157
+ command: "PERCL_COMMAND",
158
+ )
159
+ expect(instance_1.to_percl_hash).to eq(instance_2.to_percl_hash)
31
160
  end
32
161
  end
33
162
 
@@ -27,7 +27,124 @@ describe Freeclimb::PerclScript do
27
27
  end
28
28
  describe 'test attribute "commands"' do
29
29
  it 'should work' do
30
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
30
+ instance.commands = ["ELEMENT_1", "ELEMENT_2"]
31
+ expect(instance.commands).to eq(["ELEMENT_1", "ELEMENT_2"])
32
+ end
33
+ end
34
+
35
+ describe 'test method "initialize"' do
36
+ it 'properly initializes with values' do
37
+ expect{instance = Freeclimb::PerclScript.new(
38
+ commands: Array.new(),
39
+ )}.not_to raise_error()
40
+ end
41
+ it 'fails to initialize with input argument that is not a hash in Freeclimb::PerclScript' do
42
+ expect{instance = Freeclimb::PerclScript.new(
43
+ commands: Array.new(),
44
+ invalid_attribute: true
45
+ )}.to raise_error(ArgumentError)
46
+ end
47
+ it 'fails to initialize with invalid attribute' do
48
+ expect{instance = Freeclimb::PerclScript.new(
49
+ commands: Array.new(),
50
+ invalid_attribute: true
51
+ )}.to raise_error(ArgumentError)
52
+ end
53
+ end
54
+
55
+ describe 'test method "valid"' do
56
+ it 'checks if properties are valid' do
57
+ instance = Freeclimb::PerclScript.new(
58
+ commands: Array.new(),
59
+ )
60
+ expect(instance.valid?).to eq(true)
61
+ end
62
+ end
63
+
64
+ describe 'test method "eql?"' do
65
+ it 'checks if objects are equal' do
66
+ obj = Object.new()
67
+ instance_1 = Freeclimb::PerclScript.new(
68
+ commands: [],
69
+ )
70
+ instance_2 = Freeclimb::PerclScript.new(
71
+ commands: [],
72
+ )
73
+ expect(instance_1.eql?(instance_2)).to eq(true)
74
+ end
75
+ it 'checks if objects are not equal' do
76
+ instance_1 = Freeclimb::PerclScript.new(
77
+ commands: [],
78
+ )
79
+ instance_2 = Freeclimb::PerclScript.new(
80
+ commands: nil,
81
+ )
82
+ expect(instance_1.eql?(instance_2)).to eq(false)
83
+ end
84
+ end
85
+
86
+ describe 'test method "hash"' do
87
+ it 'calculates hash code' do
88
+ instance = Freeclimb::PerclScript.new(
89
+ commands: Array.new(),
90
+ )
91
+ expect(instance.hash).to be_a_kind_of(Integer)
92
+ end
93
+ end
94
+
95
+ describe 'test method "build_from_hash"' do
96
+ it 'builds equivalent model from hash code' do
97
+ instance_1 = Freeclimb::PerclScript.new(
98
+ commands: Array.new(),
99
+ )
100
+ instance_2 = Freeclimb::PerclScript.new
101
+ expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash))
102
+ end
103
+ end
104
+
105
+ describe 'test method "_deserialize"' do
106
+ instance = Freeclimb::PerclScript.new(
107
+ commands: Array.new(),
108
+ )
109
+ it 'deserializes the data of commands' do
110
+ expect(instance._deserialize("Array<PerclCommand>", instance.commands)).to be_a_kind_of(Array)
111
+ end
112
+ end
113
+
114
+ describe 'test method "to_s"' do
115
+ it 'returns the string representation of the object' do
116
+ instance = Freeclimb::PerclScript.new(
117
+ commands: Array.new(),
118
+ )
119
+ expect(instance.to_s).to eq(instance.to_hash.to_s)
120
+ end
121
+ end
122
+
123
+ describe 'test method "to_hash"' do
124
+ it 'returns the object in the form of hash' do
125
+ instance = Freeclimb::PerclScript.new(
126
+ commands: Array.new(),
127
+ )
128
+ expect(instance.to_hash).to be_a_kind_of(Hash)
129
+ end
130
+ it 'creates equal hash for two equal objects' do
131
+ obj = Object.new()
132
+ instance_1 = Freeclimb::PerclScript.new(
133
+ commands: Array.new(),
134
+ )
135
+ instance_2 = Freeclimb::PerclScript.new(
136
+ commands: Array.new(),
137
+ )
138
+ expect(instance_1.to_hash).to eq(instance_2.to_hash)
139
+ end
140
+ end
141
+
142
+ describe 'test method "_to_hash"' do
143
+ instance = Freeclimb::PerclScript.new(
144
+ commands: Array.new(),
145
+ )
146
+ it 'returns commands in the form of hash' do
147
+ expect(instance._to_hash(instance.commands)).to eq(instance.commands)
31
148
  end
32
149
  end
33
150
 
@@ -27,22 +27,66 @@ describe Freeclimb::PlayBeep do
27
27
  end
28
28
  describe 'test attribute "ALWAYS"' do
29
29
  it 'should work' do
30
- expect { Freeclimb::PlayBeep::ALWAYS = "always" }.not_to raise_error
31
- end
30
+ expect { Freeclimb::PlayBeep::ALWAYS = "always" }.not_to raise_error
32
31
  end
32
+ it 'should serialize to enum' do
33
+ expectedValue = Freeclimb::PlayBeep::ALWAYS
34
+ calculatedValue = Freeclimb::PlayBeep::build_from_hash("always")
35
+ expect(expectedValue).to eq(calculatedValue)
36
+ end
37
+ it 'should deserialize to string' do
38
+ expectedValue = "always"
39
+ calculatedValue = Freeclimb::PlayBeep::ALWAYS
40
+ expect(expectedValue).to eq(calculatedValue)
41
+ end
42
+ end
43
+
33
44
  describe 'test attribute "NEVER"' do
34
45
  it 'should work' do
35
- expect { Freeclimb::PlayBeep::NEVER = "never" }.not_to raise_error
36
- end
46
+ expect { Freeclimb::PlayBeep::NEVER = "never" }.not_to raise_error
37
47
  end
48
+ it 'should serialize to enum' do
49
+ expectedValue = Freeclimb::PlayBeep::NEVER
50
+ calculatedValue = Freeclimb::PlayBeep::build_from_hash("never")
51
+ expect(expectedValue).to eq(calculatedValue)
52
+ end
53
+ it 'should deserialize to string' do
54
+ expectedValue = "never"
55
+ calculatedValue = Freeclimb::PlayBeep::NEVER
56
+ expect(expectedValue).to eq(calculatedValue)
57
+ end
58
+ end
59
+
38
60
  describe 'test attribute "ENTRY_ONLY"' do
39
61
  it 'should work' do
40
- expect { Freeclimb::PlayBeep::ENTRY_ONLY = "entryOnly" }.not_to raise_error
41
- end
62
+ expect { Freeclimb::PlayBeep::ENTRY_ONLY = "entryOnly" }.not_to raise_error
42
63
  end
64
+ it 'should serialize to enum' do
65
+ expectedValue = Freeclimb::PlayBeep::ENTRY_ONLY
66
+ calculatedValue = Freeclimb::PlayBeep::build_from_hash("entryOnly")
67
+ expect(expectedValue).to eq(calculatedValue)
68
+ end
69
+ it 'should deserialize to string' do
70
+ expectedValue = "entryOnly"
71
+ calculatedValue = Freeclimb::PlayBeep::ENTRY_ONLY
72
+ expect(expectedValue).to eq(calculatedValue)
73
+ end
74
+ end
75
+
43
76
  describe 'test attribute "EXIT_ONLY"' do
44
77
  it 'should work' do
45
- expect { Freeclimb::PlayBeep::EXIT_ONLY = "exitOnly" }.not_to raise_error
46
- end
78
+ expect { Freeclimb::PlayBeep::EXIT_ONLY = "exitOnly" }.not_to raise_error
47
79
  end
80
+ it 'should serialize to enum' do
81
+ expectedValue = Freeclimb::PlayBeep::EXIT_ONLY
82
+ calculatedValue = Freeclimb::PlayBeep::build_from_hash("exitOnly")
83
+ expect(expectedValue).to eq(calculatedValue)
84
+ end
85
+ it 'should deserialize to string' do
86
+ expectedValue = "exitOnly"
87
+ calculatedValue = Freeclimb::PlayBeep::EXIT_ONLY
88
+ expect(expectedValue).to eq(calculatedValue)
89
+ end
90
+ end
91
+
48
92
  end
@@ -27,7 +27,124 @@ describe Freeclimb::PlayEarlyMedia do
27
27
  end
28
28
  describe 'test attribute "file"' do
29
29
  it 'should work' do
30
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
30
+ instance.file = "TEST_STRING"
31
+ expect(instance.file).to eq("TEST_STRING")
32
+ end
33
+ end
34
+
35
+ describe 'test method "initialize"' do
36
+ it 'properly initializes with values' do
37
+ expect{instance = Freeclimb::PlayEarlyMedia.new(
38
+ file: "TS",
39
+ )}.not_to raise_error()
40
+ end
41
+ it 'fails to initialize with input argument that is not a hash in Freeclimb::PlayEarlyMedia' do
42
+ expect{instance = Freeclimb::PlayEarlyMedia.new(
43
+ file: "TS",
44
+ invalid_attribute: true
45
+ )}.to raise_error(ArgumentError)
46
+ end
47
+ it 'fails to initialize with invalid attribute' do
48
+ expect{instance = Freeclimb::PlayEarlyMedia.new(
49
+ file: "TS",
50
+ invalid_attribute: true
51
+ )}.to raise_error(ArgumentError)
52
+ end
53
+ end
54
+
55
+ describe 'test method "valid"' do
56
+ it 'checks if properties are valid' do
57
+ instance = Freeclimb::PlayEarlyMedia.new(
58
+ file: "TS",
59
+ )
60
+ expect(instance.valid?).to eq(true)
61
+ end
62
+ end
63
+
64
+ describe 'test method "eql?"' do
65
+ it 'checks if objects are equal' do
66
+ obj = Object.new()
67
+ instance_1 = Freeclimb::PlayEarlyMedia.new(
68
+ file: "TS",
69
+ )
70
+ instance_2 = Freeclimb::PlayEarlyMedia.new(
71
+ file: "TS",
72
+ )
73
+ expect(instance_1.eql?(instance_2)).to eq(true)
74
+ end
75
+ it 'checks if objects are not equal' do
76
+ instance_1 = Freeclimb::PlayEarlyMedia.new(
77
+ file: "TS",
78
+ )
79
+ instance_2 = Freeclimb::PlayEarlyMedia.new(
80
+ file: "ST",
81
+ )
82
+ expect(instance_1.eql?(instance_2)).to eq(false)
83
+ end
84
+ end
85
+
86
+ describe 'test method "hash"' do
87
+ it 'calculates hash code' do
88
+ instance = Freeclimb::PlayEarlyMedia.new(
89
+ file: "TS",
90
+ )
91
+ expect(instance.hash).to be_a_kind_of(Integer)
92
+ end
93
+ end
94
+
95
+ describe 'test method "build_from_hash"' do
96
+ it 'builds equivalent model from hash code' do
97
+ instance_1 = Freeclimb::PlayEarlyMedia.new(
98
+ file: "TS",
99
+ )
100
+ instance_2 = Freeclimb::PlayEarlyMedia.new
101
+ expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash))
102
+ end
103
+ end
104
+
105
+ describe 'test method "_deserialize"' do
106
+ instance = Freeclimb::PlayEarlyMedia.new(
107
+ file: "TS",
108
+ )
109
+ it 'deserializes the data of file' do
110
+ expect(instance._deserialize("String", instance.file)).to be_a_kind_of(String)
111
+ end
112
+ end
113
+
114
+ describe 'test method "to_s"' do
115
+ it 'returns the string representation of the object' do
116
+ instance = Freeclimb::PlayEarlyMedia.new(
117
+ file: "TS",
118
+ )
119
+ expect(instance.to_s).to eq(instance.to_hash.to_s)
120
+ end
121
+ end
122
+
123
+ describe 'test method "to_hash"' do
124
+ it 'returns the object in the form of hash' do
125
+ instance = Freeclimb::PlayEarlyMedia.new(
126
+ file: "TS",
127
+ )
128
+ expect(instance.to_hash).to be_a_kind_of(Hash)
129
+ end
130
+ it 'creates equal hash for two equal objects' do
131
+ obj = Object.new()
132
+ instance_1 = Freeclimb::PlayEarlyMedia.new(
133
+ file: "TS",
134
+ )
135
+ instance_2 = Freeclimb::PlayEarlyMedia.new(
136
+ file: "TS",
137
+ )
138
+ expect(instance_1.to_hash).to eq(instance_2.to_hash)
139
+ end
140
+ end
141
+
142
+ describe 'test method "_to_hash"' do
143
+ instance = Freeclimb::PlayEarlyMedia.new(
144
+ file: "TS",
145
+ )
146
+ it 'returns file in the form of hash' do
147
+ expect(instance._to_hash(instance.file)).to eq(instance.file)
31
148
  end
32
149
  end
33
150
 
@@ -27,25 +27,214 @@ describe Freeclimb::Play do
27
27
  end
28
28
  describe 'test attribute "file"' do
29
29
  it 'should work' do
30
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
30
+ instance.file = "TEST_STRING"
31
+ expect(instance.file).to eq("TEST_STRING")
31
32
  end
32
33
  end
33
34
 
34
35
  describe 'test attribute "loop"' do
35
36
  it 'should work' do
36
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ instance.loop = 1
38
+ expect(instance.loop).to eq(1)
37
39
  end
38
40
  end
39
41
 
40
42
  describe 'test attribute "conference_id"' do
41
43
  it 'should work' do
42
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ instance.conference_id = "TEST_STRING"
45
+ expect(instance.conference_id).to eq("TEST_STRING")
43
46
  end
44
47
  end
45
48
 
46
49
  describe 'test attribute "privacy_mode"' do
47
50
  it 'should work' do
48
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
51
+ instance.privacy_mode = false
52
+ expect(instance.privacy_mode).to eq(false)
53
+ end
54
+ end
55
+
56
+ describe 'test method "initialize"' do
57
+ it 'properly initializes with values' do
58
+ expect{instance = Freeclimb::Play.new(
59
+ file: "TS",
60
+ loop: 1,
61
+ conference_id: "TS",
62
+ privacy_mode: true,
63
+ )}.not_to raise_error()
64
+ end
65
+ it 'fails to initialize with input argument that is not a hash in Freeclimb::Play' do
66
+ expect{instance = Freeclimb::Play.new(
67
+ file: "TS",
68
+ loop: 1,
69
+ conference_id: "TS",
70
+ privacy_mode: true,
71
+ invalid_attribute: true
72
+ )}.to raise_error(ArgumentError)
73
+ end
74
+ it 'fails to initialize with invalid attribute' do
75
+ expect{instance = Freeclimb::Play.new(
76
+ file: "TS",
77
+ loop: 1,
78
+ conference_id: "TS",
79
+ privacy_mode: true,
80
+ invalid_attribute: true
81
+ )}.to raise_error(ArgumentError)
82
+ end
83
+ end
84
+
85
+ describe 'test method "valid"' do
86
+ it 'checks if properties are valid' do
87
+ instance = Freeclimb::Play.new(
88
+ file: "TS",
89
+ loop: 1,
90
+ conference_id: "TS",
91
+ privacy_mode: true,
92
+ )
93
+ expect(instance.valid?).to eq(true)
94
+ end
95
+ end
96
+
97
+ describe 'test method "eql?"' do
98
+ it 'checks if objects are equal' do
99
+ obj = Object.new()
100
+ instance_1 = Freeclimb::Play.new(
101
+ file: "TS",
102
+ loop: 1,
103
+ conference_id: "TS",
104
+ privacy_mode: true,
105
+ )
106
+ instance_2 = Freeclimb::Play.new(
107
+ file: "TS",
108
+ loop: 1,
109
+ conference_id: "TS",
110
+ privacy_mode: true,
111
+ )
112
+ expect(instance_1.eql?(instance_2)).to eq(true)
113
+ end
114
+ it 'checks if objects are not equal' do
115
+ instance_1 = Freeclimb::Play.new(
116
+ file: "TS",
117
+ loop: 1,
118
+ conference_id: "TS",
119
+ privacy_mode: true,
120
+ )
121
+ instance_2 = Freeclimb::Play.new(
122
+ file: "ST",
123
+ loop: 0,
124
+ conference_id: "ST",
125
+ privacy_mode: false,
126
+ )
127
+ expect(instance_1.eql?(instance_2)).to eq(false)
128
+ end
129
+ end
130
+
131
+ describe 'test method "hash"' do
132
+ it 'calculates hash code' do
133
+ instance = Freeclimb::Play.new(
134
+ file: "TS",
135
+ loop: 1,
136
+ conference_id: "TS",
137
+ privacy_mode: true,
138
+ )
139
+ expect(instance.hash).to be_a_kind_of(Integer)
140
+ end
141
+ end
142
+
143
+ describe 'test method "build_from_hash"' do
144
+ it 'builds equivalent model from hash code' do
145
+ instance_1 = Freeclimb::Play.new(
146
+ file: "TS",
147
+ loop: 1,
148
+ conference_id: "TS",
149
+ privacy_mode: true,
150
+ )
151
+ instance_2 = Freeclimb::Play.new
152
+ expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash))
153
+ end
154
+ end
155
+
156
+ describe 'test method "_deserialize"' do
157
+ instance = Freeclimb::Play.new(
158
+ file: "TS",
159
+ loop: 1,
160
+ conference_id: "TS",
161
+ privacy_mode: true,
162
+ )
163
+ it 'deserializes the data of file' do
164
+ expect(instance._deserialize("String", instance.file)).to be_a_kind_of(String)
165
+ end
166
+ it 'deserializes the data of loop' do
167
+ expect(instance._deserialize("Integer", instance.loop)).to be_a_kind_of(Integer)
168
+ end
169
+ it 'deserializes the data of conference_id' do
170
+ expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String)
171
+ end
172
+ it 'deserializes the data of privacy_mode' do
173
+ expect(instance._deserialize("Boolean", instance.privacy_mode)).to be_a_kind_of(TrueClass)
174
+ end
175
+ end
176
+
177
+ describe 'test method "to_s"' do
178
+ it 'returns the string representation of the object' do
179
+ instance = Freeclimb::Play.new(
180
+ file: "TS",
181
+ loop: 1,
182
+ conference_id: "TS",
183
+ privacy_mode: true,
184
+ )
185
+ expect(instance.to_s).to eq(instance.to_hash.to_s)
186
+ end
187
+ end
188
+
189
+ describe 'test method "to_hash"' do
190
+ it 'returns the object in the form of hash' do
191
+ instance = Freeclimb::Play.new(
192
+ file: "TS",
193
+ loop: 1,
194
+ conference_id: "TS",
195
+ privacy_mode: true,
196
+ )
197
+ expect(instance.to_hash).to be_a_kind_of(Hash)
198
+ end
199
+ it 'creates equal hash for two equal objects' do
200
+ obj = Object.new()
201
+ instance_1 = Freeclimb::Play.new(
202
+ file: "TS",
203
+ loop: 1,
204
+ conference_id: "TS",
205
+ privacy_mode: true,
206
+ )
207
+ instance_2 = Freeclimb::Play.new(
208
+ file: "TS",
209
+ loop: 1,
210
+ conference_id: "TS",
211
+ privacy_mode: true,
212
+ )
213
+ expect(instance_1.to_hash).to eq(instance_2.to_hash)
214
+ end
215
+ end
216
+
217
+ describe 'test method "_to_hash"' do
218
+ instance = Freeclimb::Play.new(
219
+ file: "TS",
220
+
221
+ loop: 1,
222
+
223
+ conference_id: "TS",
224
+
225
+ privacy_mode: true,
226
+ )
227
+ it 'returns file in the form of hash' do
228
+ expect(instance._to_hash(instance.file)).to eq(instance.file)
229
+ end
230
+ it 'returns loop in the form of hash' do
231
+ expect(instance._to_hash(instance.loop)).to eq(instance.loop)
232
+ end
233
+ it 'returns conference_id in the form of hash' do
234
+ expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id)
235
+ end
236
+ it 'returns privacy_mode in the form of hash' do
237
+ expect(instance._to_hash(instance.privacy_mode)).to eq(instance.privacy_mode)
49
238
  end
50
239
  end
51
240