opentok 4.1.1 → 4.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55309730e5aa9927756e9003fb5745c497e3956e5fab4810a280cfcab77614fa
4
- data.tar.gz: ed3f6dcf6577b28f762503c7d271a485d03cdf27862a358a809951d09f9747b1
3
+ metadata.gz: 74581fd2fb2645cd163ed9a979fcfbb8cfd13da7cf0530bd49364a8a63ce0164
4
+ data.tar.gz: 8a21fb081a3be5c24a3a321442af11a56ef960ea489b1482abd876adc4d09e44
5
5
  SHA512:
6
- metadata.gz: cfecdaf4cd7eeef31be4e6fb9e2b146007c1c9305051483400d4764508066dc62f45cd74a31a4c604b50cfb79aac48310821e7bd88956513a83bdaf07a107f89
7
- data.tar.gz: ab5b745259d82e5c79b8ad25c794e0dafe66eb3d5205909a4659bafcfa696a5160949c12841de5b87b444635e8d70517158ee73627976a33c9188d90eae37c4f
6
+ metadata.gz: dfbddec4e8e490a017817e05a1ec9c14b51b655a15f263ab15b2d461118330b34fb1296f8e614d76bbf480893856ad2b0d6202175de786499bbce001d5ce5943
7
+ data.tar.gz: 3cc40c6ba443524d7470ee2d331fe20cfb7f86b69067b56d22f957d2d01715334faa668d2e5121062cb5f393503924ce8cb73c5fe8be523cb1b1968d17ebaa2e
@@ -209,7 +209,7 @@ module OpenTok
209
209
  type = options[:type]
210
210
  raise ArgumentError, "custom type must have a stylesheet" if (type.eql? "custom") && (!options.key? :stylesheet)
211
211
  valid_non_custom_type = ["bestFit","horizontalPresentation","pip", "verticalPresentation", ""].include? type
212
- raise ArgumentError, "type is not valid or stylesheet not needed" if !valid_non_custom_type
212
+ raise ArgumentError, "type is not valid" if !valid_non_custom_type && !(type.eql? "custom")
213
213
  raise ArgumentError, "type is not valid or stylesheet not needed" if valid_non_custom_type and options.key? :stylesheet
214
214
  response = @client.layout_archive(archive_id, options)
215
215
  (200..300).include? response.code
@@ -138,7 +138,7 @@ module OpenTok
138
138
  type = options[:type]
139
139
  raise ArgumentError, "custom type must have a stylesheet" if (type.eql? "custom") && (!options.key? :stylesheet)
140
140
  valid_non_custom_type = ["bestFit","horizontalPresentation","pip", "verticalPresentation", ""].include? type
141
- raise ArgumentError, "type is not valid" if !valid_non_custom_type
141
+ raise ArgumentError, "type is not valid" if !valid_non_custom_type && !(type.eql? "custom")
142
142
  raise ArgumentError, "stylesheet not needed" if valid_non_custom_type and options.key? :stylesheet
143
143
  response = @client.layout_broadcast(broadcast_id, options)
144
144
  (200..300).include? response.code
@@ -1,4 +1,4 @@
1
1
  module OpenTok
2
2
  # @private
3
- VERSION = '4.1.1'
3
+ VERSION = '4.1.2'
4
4
  end
@@ -144,6 +144,27 @@ describe OpenTok::Broadcasts do
144
144
  }.to raise_error(ArgumentError)
145
145
  end
146
146
 
147
+ it "raise an error for non valid type" do
148
+ expect {
149
+ broadcast.layout(started_broadcast_id, {
150
+ type: "not-valid",
151
+ stylesheet: "stream {}"
152
+ })
153
+ }.to raise_error(ArgumentError)
154
+ end
155
+
156
+ it "change the layout to custom type with custom stylesheet" do
157
+ stub_request(:put, "https://api.opentok.com/v2/project/#{api_key}/broadcast/#{started_broadcast_id}/layout").
158
+ with(body: {type: 'custom', stylesheet: 'stream {float: left; height: 100%; width: 33.33%;}'}).
159
+ to_return(status: 200)
160
+
161
+ response = broadcast.layout(started_broadcast_id, {
162
+ type: "custom",
163
+ stylesheet: "stream {float: left; height: 100%; width: 33.33%;}"
164
+ })
165
+ expect(response).not_to be_nil
166
+ end
167
+
147
168
  it "raise an error if invalid layout type" do
148
169
  expect {
149
170
  broadcast.layout(started_broadcast_id, {
@@ -162,10 +183,13 @@ describe OpenTok::Broadcasts do
162
183
  }.to raise_error(ArgumentError)
163
184
  end
164
185
  it "changes the layout of a broadcast", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
186
+ stub_request(:put, "https://api.opentok.com/v2/project/#{api_key}/broadcast/#{started_broadcast_id}/layout").
187
+ to_return(status: 200)
188
+
165
189
  response = broadcast.layout(started_broadcast_id, {
166
190
  :type => "verticalPresentation"
167
191
  })
168
192
  expect(response).not_to be_nil
169
193
  end
170
194
 
171
- end
195
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentok
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 4.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stijn Mathysen
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2020-06-26 00:00:00.000000000 Z
15
+ date: 2020-07-15 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bundler