|
38 | 38 |
|
39 | 39 | expected_messages_hash = { |
40 | 40 | "" => [ |
41 | | - Google::Cloud::PubSub::V1::PubsubMessage.new(data: "async-message".encode(Encoding::ASCII_8BIT)) |
| 41 | + Google::Cloud::PubSub::V1::PubsubMessage.new(data: "async-message".b) |
42 | 42 | ] |
43 | 43 | } |
44 | 44 | published_messages_hash = publisher.service.mocked_topic_admin.message_hash |
|
129 | 129 | assert_kind_of Google::Cloud::PubSub::PublishResult, result |
130 | 130 | assert result.succeeded? |
131 | 131 | assert_equal "msg0", result.msg_id |
132 | | - assert_equal "\xE3\x81\x82".force_encoding(Encoding::ASCII_8BIT), result.data |
| 132 | + assert_equal "\xE3\x81\x82".b, result.data |
133 | 133 | callback_called = true |
134 | 134 | end |
135 | 135 |
|
|
146 | 146 |
|
147 | 147 | expected_messages_hash = { |
148 | 148 | "" => [ |
149 | | - Google::Cloud::PubSub::V1::PubsubMessage.new(data: "\xE3\x81\x82".force_encoding(Encoding::ASCII_8BIT), message_id: "msg0") |
| 149 | + Google::Cloud::PubSub::V1::PubsubMessage.new(data: "\xE3\x81\x82".b, message_id: "msg0") |
150 | 150 | ] |
151 | 151 | } |
152 | 152 | published_messages_hash = publisher.service.mocked_topic_admin.message_hash |
|
170 | 170 | assert_kind_of Google::Cloud::PubSub::PublishResult, result |
171 | 171 | assert result.succeeded? |
172 | 172 | assert_equal "msg0", result.msg_id |
173 | | - assert_equal "\xE3\x81\x82".force_encoding(Encoding::ASCII_8BIT), result.data |
| 173 | + assert_equal "\xE3\x81\x82".b, result.data |
174 | 174 | callback_called = true |
175 | 175 | end |
176 | 176 | end |
|
188 | 188 |
|
189 | 189 | expected_messages_hash = { |
190 | 190 | "" => [ |
191 | | - Google::Cloud::PubSub::V1::PubsubMessage.new(data: "\xE3\x81\x82".force_encoding(Encoding::ASCII_8BIT), message_id: "msg0") |
| 191 | + Google::Cloud::PubSub::V1::PubsubMessage.new(data: "\xE3\x81\x82".b, message_id: "msg0") |
192 | 192 | ] |
193 | 193 | } |
194 | 194 | published_messages_hash = publisher.service.mocked_topic_admin.message_hash |
|
207 | 207 | assert_kind_of Google::Cloud::PubSub::PublishResult, result |
208 | 208 | assert result.succeeded? |
209 | 209 | assert_equal "msg0", result.msg_id |
210 | | - assert_equal "async-message".force_encoding(Encoding::ASCII_8BIT), result.data |
| 210 | + assert_equal "async-message".b, result.data |
211 | 211 | assert_equal "text", result.attributes["format"] |
212 | 212 | callback_called = true |
213 | 213 | end |
|
225 | 225 |
|
226 | 226 | expected_messages_hash = { |
227 | 227 | "" => [ |
228 | | - Google::Cloud::PubSub::V1::PubsubMessage.new(data: "async-message".encode(Encoding::ASCII_8BIT), attributes: {"format" => "text"}, message_id: "msg0") |
| 228 | + Google::Cloud::PubSub::V1::PubsubMessage.new(data: "async-message".b, attributes: {"format" => "text"}, message_id: "msg0") |
229 | 229 | ] |
230 | 230 | } |
231 | 231 | published_messages_hash = publisher.service.mocked_topic_admin.message_hash |
|
257 | 257 |
|
258 | 258 | expected_messages_hash = { |
259 | 259 | "" => [ |
260 | | - Google::Cloud::PubSub::V1::PubsubMessage.new(data: "async-message".encode(Encoding::ASCII_8BIT)) |
| 260 | + Google::Cloud::PubSub::V1::PubsubMessage.new(data: "async-message".b) |
261 | 261 | ] |
262 | 262 | } |
263 | 263 | published_messages_hash = publisher.service.mocked_topic_admin.message_hash |
|
275 | 275 | assert_kind_of Google::Cloud::PubSub::PublishResult, result |
276 | 276 | assert result.succeeded? |
277 | 277 | assert_equal "msg0", result.msg_id |
278 | | - assert_equal "async-message".force_encoding(Encoding::ASCII_8BIT), result.data |
| 278 | + assert_equal "async-message".b, result.data |
279 | 279 | assert_equal "text", result.attributes["format"] |
280 | 280 | callback_called = true |
281 | 281 | end |
|
293 | 293 |
|
294 | 294 | expected_messages_hash = { |
295 | 295 | "" => [ |
296 | | - Google::Cloud::PubSub::V1::PubsubMessage.new(data: "async-message".encode(Encoding::ASCII_8BIT), attributes: { "format" => "text" }, message_id: "msg0") |
| 296 | + Google::Cloud::PubSub::V1::PubsubMessage.new(data: "async-message".b, attributes: { "format" => "text" }, message_id: "msg0") |
297 | 297 | ] |
298 | 298 | } |
299 | 299 | published_messages_hash = publisher.service.mocked_topic_admin.message_hash |
|
0 commit comments