spec/acceptance/realtime/message_spec.rb in ably-1.2.2 vs spec/acceptance/realtime/message_spec.rb in ably-1.2.3
- old
+ new
@@ -521,25 +521,25 @@
end
end
resources_root = File.expand_path('../../../../lib/submodules/ably-common/test-resources', __FILE__)
- def self.add_tests_for_data(data)
+ shared_examples 'add_tests_for_data' do |data|
data['items'].each_with_index do |item, index|
context "item #{index} with encrypted encoding #{item['encrypted']['encoding']}" do
it_behaves_like 'an Ably encrypter and decrypter', item, data
end
end
end
context 'with AES-128-CBC using crypto-data-128.json fixtures (#RTL7d)' do
data = JSON.parse(File.read(File.join(resources_root, 'crypto-data-128.json')))
- add_tests_for_data data
+ include_examples 'add_tests_for_data', data
end
context 'with AES-256-CBC using crypto-data-256.json fixtures (#RTL7d)' do
data = JSON.parse(File.read(File.join(resources_root, 'crypto-data-256.json')))
- add_tests_for_data data
+ include_examples 'add_tests_for_data', data
end
context 'with multiple sends from one client to another' do
let(:cipher_options) { { key: Ably::Util::Crypto.generate_random_key } }
let(:encrypted_channel_client1) { client.channel(channel_name, cipher: cipher_options) }