ably-rest 0.7.1 → 0.7.3

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.
Files changed (148) hide show
  1. checksums.yaml +13 -5
  2. data/.gitmodules +1 -1
  3. data/.rspec +1 -0
  4. data/.travis.yml +7 -3
  5. data/SPEC.md +495 -419
  6. data/ably-rest.gemspec +19 -5
  7. data/lib/ably-rest.rb +9 -1
  8. data/lib/submodules/ably-ruby/.gitignore +6 -0
  9. data/lib/submodules/ably-ruby/.rspec +1 -0
  10. data/lib/submodules/ably-ruby/.ruby-version.old +1 -0
  11. data/lib/submodules/ably-ruby/.travis.yml +10 -0
  12. data/lib/submodules/ably-ruby/Gemfile +4 -0
  13. data/lib/submodules/ably-ruby/LICENSE.txt +22 -0
  14. data/lib/submodules/ably-ruby/README.md +122 -0
  15. data/lib/submodules/ably-ruby/Rakefile +34 -0
  16. data/lib/submodules/ably-ruby/SPEC.md +1794 -0
  17. data/lib/submodules/ably-ruby/ably.gemspec +36 -0
  18. data/lib/submodules/ably-ruby/lib/ably.rb +12 -0
  19. data/lib/submodules/ably-ruby/lib/ably/auth.rb +438 -0
  20. data/lib/submodules/ably-ruby/lib/ably/exceptions.rb +69 -0
  21. data/lib/submodules/ably-ruby/lib/ably/logger.rb +102 -0
  22. data/lib/submodules/ably-ruby/lib/ably/models/error_info.rb +37 -0
  23. data/lib/submodules/ably-ruby/lib/ably/models/idiomatic_ruby_wrapper.rb +223 -0
  24. data/lib/submodules/ably-ruby/lib/ably/models/message.rb +132 -0
  25. data/lib/submodules/ably-ruby/lib/ably/models/message_encoders/base.rb +108 -0
  26. data/lib/submodules/ably-ruby/lib/ably/models/message_encoders/base64.rb +40 -0
  27. data/lib/submodules/ably-ruby/lib/ably/models/message_encoders/cipher.rb +83 -0
  28. data/lib/submodules/ably-ruby/lib/ably/models/message_encoders/json.rb +34 -0
  29. data/lib/submodules/ably-ruby/lib/ably/models/message_encoders/utf8.rb +26 -0
  30. data/lib/submodules/ably-ruby/lib/ably/models/nil_logger.rb +20 -0
  31. data/lib/submodules/ably-ruby/lib/ably/models/paginated_resource.rb +173 -0
  32. data/lib/submodules/ably-ruby/lib/ably/models/presence_message.rb +147 -0
  33. data/lib/submodules/ably-ruby/lib/ably/models/protocol_message.rb +210 -0
  34. data/lib/submodules/ably-ruby/lib/ably/models/stat.rb +161 -0
  35. data/lib/submodules/ably-ruby/lib/ably/models/token.rb +74 -0
  36. data/lib/submodules/ably-ruby/lib/ably/modules/ably.rb +15 -0
  37. data/lib/submodules/ably-ruby/lib/ably/modules/async_wrapper.rb +62 -0
  38. data/lib/submodules/ably-ruby/lib/ably/modules/channels_collection.rb +69 -0
  39. data/lib/submodules/ably-ruby/lib/ably/modules/conversions.rb +100 -0
  40. data/lib/submodules/ably-ruby/lib/ably/modules/encodeable.rb +69 -0
  41. data/lib/submodules/ably-ruby/lib/ably/modules/enum.rb +202 -0
  42. data/lib/submodules/ably-ruby/lib/ably/modules/event_emitter.rb +128 -0
  43. data/lib/submodules/ably-ruby/lib/ably/modules/event_machine_helpers.rb +26 -0
  44. data/lib/submodules/ably-ruby/lib/ably/modules/http_helpers.rb +41 -0
  45. data/lib/submodules/ably-ruby/lib/ably/modules/message_pack.rb +14 -0
  46. data/lib/submodules/ably-ruby/lib/ably/modules/model_common.rb +41 -0
  47. data/lib/submodules/ably-ruby/lib/ably/modules/state_emitter.rb +153 -0
  48. data/lib/submodules/ably-ruby/lib/ably/modules/state_machine.rb +57 -0
  49. data/lib/submodules/ably-ruby/lib/ably/modules/statesman_monkey_patch.rb +33 -0
  50. data/lib/submodules/ably-ruby/lib/ably/modules/uses_state_machine.rb +74 -0
  51. data/lib/submodules/ably-ruby/lib/ably/realtime.rb +64 -0
  52. data/lib/submodules/ably-ruby/lib/ably/realtime/channel.rb +298 -0
  53. data/lib/submodules/ably-ruby/lib/ably/realtime/channel/channel_manager.rb +92 -0
  54. data/lib/submodules/ably-ruby/lib/ably/realtime/channel/channel_state_machine.rb +69 -0
  55. data/lib/submodules/ably-ruby/lib/ably/realtime/channels.rb +50 -0
  56. data/lib/submodules/ably-ruby/lib/ably/realtime/client.rb +184 -0
  57. data/lib/submodules/ably-ruby/lib/ably/realtime/client/incoming_message_dispatcher.rb +184 -0
  58. data/lib/submodules/ably-ruby/lib/ably/realtime/client/outgoing_message_dispatcher.rb +70 -0
  59. data/lib/submodules/ably-ruby/lib/ably/realtime/connection.rb +445 -0
  60. data/lib/submodules/ably-ruby/lib/ably/realtime/connection/connection_manager.rb +368 -0
  61. data/lib/submodules/ably-ruby/lib/ably/realtime/connection/connection_state_machine.rb +91 -0
  62. data/lib/submodules/ably-ruby/lib/ably/realtime/connection/websocket_transport.rb +188 -0
  63. data/lib/submodules/ably-ruby/lib/ably/realtime/models/nil_channel.rb +30 -0
  64. data/lib/submodules/ably-ruby/lib/ably/realtime/presence.rb +564 -0
  65. data/lib/submodules/ably-ruby/lib/ably/rest.rb +43 -0
  66. data/lib/submodules/ably-ruby/lib/ably/rest/channel.rb +104 -0
  67. data/lib/submodules/ably-ruby/lib/ably/rest/channels.rb +44 -0
  68. data/lib/submodules/ably-ruby/lib/ably/rest/client.rb +396 -0
  69. data/lib/submodules/ably-ruby/lib/ably/rest/middleware/encoder.rb +49 -0
  70. data/lib/submodules/ably-ruby/lib/ably/rest/middleware/exceptions.rb +41 -0
  71. data/lib/submodules/ably-ruby/lib/ably/rest/middleware/external_exceptions.rb +24 -0
  72. data/lib/submodules/ably-ruby/lib/ably/rest/middleware/fail_if_unsupported_mime_type.rb +17 -0
  73. data/lib/submodules/ably-ruby/lib/ably/rest/middleware/logger.rb +58 -0
  74. data/lib/submodules/ably-ruby/lib/ably/rest/middleware/parse_json.rb +27 -0
  75. data/lib/submodules/ably-ruby/lib/ably/rest/middleware/parse_message_pack.rb +27 -0
  76. data/lib/submodules/ably-ruby/lib/ably/rest/presence.rb +92 -0
  77. data/lib/submodules/ably-ruby/lib/ably/util/crypto.rb +105 -0
  78. data/lib/submodules/ably-ruby/lib/ably/util/pub_sub.rb +43 -0
  79. data/lib/submodules/ably-ruby/lib/ably/version.rb +3 -0
  80. data/lib/submodules/ably-ruby/spec/acceptance/realtime/channel_history_spec.rb +154 -0
  81. data/lib/submodules/ably-ruby/spec/acceptance/realtime/channel_spec.rb +558 -0
  82. data/lib/submodules/ably-ruby/spec/acceptance/realtime/client_spec.rb +119 -0
  83. data/lib/submodules/ably-ruby/spec/acceptance/realtime/connection_failures_spec.rb +575 -0
  84. data/lib/submodules/ably-ruby/spec/acceptance/realtime/connection_spec.rb +785 -0
  85. data/lib/submodules/ably-ruby/spec/acceptance/realtime/message_spec.rb +457 -0
  86. data/lib/submodules/ably-ruby/spec/acceptance/realtime/presence_history_spec.rb +55 -0
  87. data/lib/submodules/ably-ruby/spec/acceptance/realtime/presence_spec.rb +1001 -0
  88. data/lib/submodules/ably-ruby/spec/acceptance/realtime/stats_spec.rb +23 -0
  89. data/lib/submodules/ably-ruby/spec/acceptance/realtime/time_spec.rb +27 -0
  90. data/lib/submodules/ably-ruby/spec/acceptance/rest/auth_spec.rb +564 -0
  91. data/lib/submodules/ably-ruby/spec/acceptance/rest/base_spec.rb +165 -0
  92. data/lib/submodules/ably-ruby/spec/acceptance/rest/channel_spec.rb +134 -0
  93. data/lib/submodules/ably-ruby/spec/acceptance/rest/channels_spec.rb +41 -0
  94. data/lib/submodules/ably-ruby/spec/acceptance/rest/client_spec.rb +273 -0
  95. data/lib/submodules/ably-ruby/spec/acceptance/rest/encoders_spec.rb +185 -0
  96. data/lib/submodules/ably-ruby/spec/acceptance/rest/message_spec.rb +247 -0
  97. data/lib/submodules/ably-ruby/spec/acceptance/rest/presence_spec.rb +292 -0
  98. data/lib/submodules/ably-ruby/spec/acceptance/rest/stats_spec.rb +172 -0
  99. data/lib/submodules/ably-ruby/spec/acceptance/rest/time_spec.rb +15 -0
  100. data/lib/submodules/ably-ruby/spec/resources/crypto-data-128.json +56 -0
  101. data/lib/submodules/ably-ruby/spec/resources/crypto-data-256.json +56 -0
  102. data/lib/submodules/ably-ruby/spec/rspec_config.rb +57 -0
  103. data/lib/submodules/ably-ruby/spec/shared/client_initializer_behaviour.rb +212 -0
  104. data/lib/submodules/ably-ruby/spec/shared/model_behaviour.rb +86 -0
  105. data/lib/submodules/ably-ruby/spec/shared/protocol_msgbus_behaviour.rb +36 -0
  106. data/lib/submodules/ably-ruby/spec/spec_helper.rb +20 -0
  107. data/lib/submodules/ably-ruby/spec/support/api_helper.rb +60 -0
  108. data/lib/submodules/ably-ruby/spec/support/event_machine_helper.rb +104 -0
  109. data/lib/submodules/ably-ruby/spec/support/markdown_spec_formatter.rb +118 -0
  110. data/lib/submodules/ably-ruby/spec/support/private_api_formatter.rb +36 -0
  111. data/lib/submodules/ably-ruby/spec/support/protocol_helper.rb +32 -0
  112. data/lib/submodules/ably-ruby/spec/support/random_helper.rb +15 -0
  113. data/lib/submodules/ably-ruby/spec/support/rest_testapp_before_retry.rb +15 -0
  114. data/lib/submodules/ably-ruby/spec/support/test_app.rb +113 -0
  115. data/lib/submodules/ably-ruby/spec/unit/auth_spec.rb +68 -0
  116. data/lib/submodules/ably-ruby/spec/unit/logger_spec.rb +146 -0
  117. data/lib/submodules/ably-ruby/spec/unit/models/error_info_spec.rb +18 -0
  118. data/lib/submodules/ably-ruby/spec/unit/models/idiomatic_ruby_wrapper_spec.rb +349 -0
  119. data/lib/submodules/ably-ruby/spec/unit/models/message_encoders/base64_spec.rb +181 -0
  120. data/lib/submodules/ably-ruby/spec/unit/models/message_encoders/cipher_spec.rb +260 -0
  121. data/lib/submodules/ably-ruby/spec/unit/models/message_encoders/json_spec.rb +135 -0
  122. data/lib/submodules/ably-ruby/spec/unit/models/message_encoders/utf8_spec.rb +56 -0
  123. data/lib/submodules/ably-ruby/spec/unit/models/message_spec.rb +389 -0
  124. data/lib/submodules/ably-ruby/spec/unit/models/paginated_resource_spec.rb +288 -0
  125. data/lib/submodules/ably-ruby/spec/unit/models/presence_message_spec.rb +386 -0
  126. data/lib/submodules/ably-ruby/spec/unit/models/protocol_message_spec.rb +315 -0
  127. data/lib/submodules/ably-ruby/spec/unit/models/stat_spec.rb +113 -0
  128. data/lib/submodules/ably-ruby/spec/unit/models/token_spec.rb +86 -0
  129. data/lib/submodules/ably-ruby/spec/unit/modules/async_wrapper_spec.rb +124 -0
  130. data/lib/submodules/ably-ruby/spec/unit/modules/conversions_spec.rb +72 -0
  131. data/lib/submodules/ably-ruby/spec/unit/modules/enum_spec.rb +272 -0
  132. data/lib/submodules/ably-ruby/spec/unit/modules/event_emitter_spec.rb +184 -0
  133. data/lib/submodules/ably-ruby/spec/unit/modules/state_emitter_spec.rb +283 -0
  134. data/lib/submodules/ably-ruby/spec/unit/realtime/channel_spec.rb +206 -0
  135. data/lib/submodules/ably-ruby/spec/unit/realtime/channels_spec.rb +81 -0
  136. data/lib/submodules/ably-ruby/spec/unit/realtime/client_spec.rb +30 -0
  137. data/lib/submodules/ably-ruby/spec/unit/realtime/connection_spec.rb +33 -0
  138. data/lib/submodules/ably-ruby/spec/unit/realtime/incoming_message_dispatcher_spec.rb +36 -0
  139. data/lib/submodules/ably-ruby/spec/unit/realtime/presence_spec.rb +111 -0
  140. data/lib/submodules/ably-ruby/spec/unit/realtime/realtime_spec.rb +9 -0
  141. data/lib/submodules/ably-ruby/spec/unit/realtime/websocket_transport_spec.rb +25 -0
  142. data/lib/submodules/ably-ruby/spec/unit/rest/channel_spec.rb +109 -0
  143. data/lib/submodules/ably-ruby/spec/unit/rest/channels_spec.rb +79 -0
  144. data/lib/submodules/ably-ruby/spec/unit/rest/client_spec.rb +53 -0
  145. data/lib/submodules/ably-ruby/spec/unit/rest/rest_spec.rb +10 -0
  146. data/lib/submodules/ably-ruby/spec/unit/util/crypto_spec.rb +87 -0
  147. data/lib/submodules/ably-ruby/spec/unit/util/pub_sub_spec.rb +86 -0
  148. metadata +182 -27
data/ably-rest.gemspec CHANGED
@@ -1,7 +1,13 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib/submodules/ably-ruby/lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'ably/version'
1
+ # encoding: utf-8
2
+ File.expand_path('../lib/submodules/ably-ruby/lib', __FILE__).tap do |lib|
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ begin
6
+ require File.join(lib, 'ably/version')
7
+ rescue LoadError => e
8
+ fail "#{e.message}\nAre you sure the submodule for ably-ruby exists at lib/submodules? If not, run `git submodule init && git submodule update`"
9
+ end
10
+ end
5
11
 
6
12
  Gem::Specification.new do |spec|
7
13
  spec.name = 'ably-rest'
@@ -13,7 +19,14 @@ Gem::Specification.new do |spec|
13
19
  spec.homepage = 'http://github.com/ably/ably-ruby-rest'
14
20
  spec.license = 'MIT'
15
21
 
16
- spec.files = `git ls-files`.split($/)
22
+ submodule_path = File.expand_path('../lib/submodules/ably-ruby', __FILE__)
23
+ submodule_files = Dir.chdir(submodule_path) do
24
+ `git ls-files`.split($\).map do |file|
25
+ "lib/submodules/ably-ruby/#{file}"
26
+ end
27
+ end
28
+
29
+ spec.files = `git ls-files`.split($/) + submodule_files
17
30
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
31
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
32
  spec.require_paths = ['lib']
@@ -26,6 +39,7 @@ Gem::Specification.new do |spec|
26
39
  spec.add_development_dependency 'rake'
27
40
  spec.add_development_dependency 'redcarpet'
28
41
  spec.add_development_dependency 'rspec', '~> 3.0'
42
+ spec.add_development_dependency 'rspec-retry'
29
43
  spec.add_development_dependency 'yard'
30
44
  spec.add_development_dependency 'webmock'
31
45
  end
data/lib/ably-rest.rb CHANGED
@@ -1,4 +1,12 @@
1
- $:.unshift File.expand_path('submodules/ably-ruby/lib', File.dirname(__FILE__))
1
+ File.expand_path('submodules/ably-ruby/lib', File.dirname(__FILE__)).tap do |lib|
2
+ $LOAD_PATH.unshift lib
3
+
4
+ begin
5
+ require File.join(lib, 'ably/version')
6
+ rescue LoadError => e
7
+ fail "#{e.message}\nAre you sure the submodule for ably-ruby exists at lib/submodules? If not, run `git submodule init && git submodule update`"
8
+ end
9
+ end
2
10
 
3
11
  %w(modules util).each do |namespace|
4
12
  ignore_modules = /^async|event_machine|state_machine/
@@ -0,0 +1,6 @@
1
+ Gemfile.lock
2
+ .yardoc
3
+ doc/*
4
+ pkg
5
+ .bundle
6
+ bin
@@ -0,0 +1 @@
1
+ --color --format documentation
@@ -0,0 +1 @@
1
+ 1.9.3-p547
@@ -0,0 +1,10 @@
1
+ env: RSPEC_RETRY=true
2
+ language: ruby
3
+ rvm:
4
+ - 1.9.3
5
+ - 2.0.0
6
+ - 2.2.0
7
+ script: bundle exec rspec
8
+ notifications:
9
+ slack:
10
+ secure: Xe8MwDcV2C8XLGk6O6Co31LpQiRSxsmS7Toy5vM7rHds5fnVRBNn5iX6Q5mXMdLOlnsMhjKLt7zl4fsBOZv+siQ+Us0omZSIYpXCYSCIj8nofReF0Lj8M4oa6lFSL5OuygO7PH+wLKTRxQURGZ6Pi1nHU+RE5izRmsewQHkhtY0=
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ably.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Ably
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,122 @@
1
+ # [Ably](https://ably.io)
2
+
3
+ [![Build Status](https://travis-ci.org/ably/ably-ruby.png)](https://travis-ci.org/ably/ably-ruby)
4
+ [![Gem Version](https://badge.fury.io/rb/ably.svg)](http://badge.fury.io/rb/ably)
5
+
6
+ A Ruby client library for [ably.io](https://ably.io), the real-time messaging service.
7
+
8
+ ## Installation
9
+
10
+ The client library is available as a [gem from RubyGems.org](https://rubygems.org/gems/ably).
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ gem 'ably'
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install ably
23
+
24
+ ## Using the Realtime API
25
+
26
+ ### Subscribing to a channel
27
+
28
+ Given:
29
+
30
+ ```ruby
31
+ client = Ably::Realtime.new(api_key: "xxxxx")
32
+ channel = client.channel("test")
33
+ ```
34
+
35
+ Subscribe to all events:
36
+
37
+ ```ruby
38
+ channel.subscribe do |message|
39
+ message[:name] #=> "greeting"
40
+ message[:data] #=> "Hello World!"
41
+ end
42
+ ```
43
+
44
+ Only certain events:
45
+
46
+ ```ruby
47
+ channel.subscribe("myEvent") do |message|
48
+ message[:name] #=> "myEvent"
49
+ message[:data] #=> "myData"
50
+ end
51
+ ```
52
+
53
+ ### Publishing to a channel
54
+
55
+ ```ruby
56
+ client = Ably::Realtime.new(api_key: "xxxxx")
57
+ channel = client.channel("test")
58
+ channel.publish("greeting", "Hello World!")
59
+ ```
60
+
61
+ ### Presence on a channel
62
+
63
+ ```ruby
64
+ client = Ably::Realtime.new(api_key: "xxxxx")
65
+ channel = client.channel("test")
66
+ channel.presence.enter(data: 'john.doe') do |presence|
67
+ presence.get #=> [Array of members present]
68
+ end
69
+ ```
70
+
71
+ ## Using the REST API
72
+
73
+ ### Publishing a message to a channel
74
+
75
+ ```ruby
76
+ client = Ably::Rest.new(api_key: "xxxxx")
77
+ channel = client.channel("test")
78
+ channel.publish("myEvent", "Hello!") #=> true
79
+ ```
80
+
81
+ ### Fetching a channel's history
82
+
83
+ ```ruby
84
+ client = Ably::Rest.new(api_key: "xxxxx")
85
+ channel = client.channel("test")
86
+ channel.history #=> [{:name=>"test", :data=>"payload"}]
87
+ ```
88
+
89
+ ### Authentication with a token
90
+
91
+ ```ruby
92
+ client = Ably::Rest.new(api_key: "xxxxx")
93
+ client.auth.authorise # creates a token and will use token authentication moving forwards
94
+ client.auth.current_token #=> #<Ably::Models::Token>
95
+ channel.publish("myEvent", "Hello!") #=> true, sent using token authentication
96
+ ```
97
+
98
+ ### Fetching your application's stats
99
+
100
+ ```ruby
101
+ client = Ably::Rest.new(api_key: "xxxxx")
102
+ client.stats #=> [{:channels=>..., :apiRequests=>..., ...}]
103
+ ```
104
+
105
+ ### Fetching the Ably service time
106
+
107
+ ```ruby
108
+ client = Ably::Rest.new(api_key: "xxxxx")
109
+ client.time #=> 2013-12-12 14:23:34 +0000
110
+ ```
111
+
112
+ ## Dependencies
113
+
114
+ If you only need to use the REST features of this library and do not want EventMachine as a dependency, then you should use the [Ably Ruby REST gem](https://rubygems.org/gems/ably-rest).
115
+
116
+ ## Contributing
117
+
118
+ 1. Fork it
119
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
120
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
121
+ 4. Push to the branch (`git push origin my-new-feature`)
122
+ 5. Create new Pull Request
@@ -0,0 +1,34 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ require 'bundler/gem_tasks'
4
+ require 'json'
5
+
6
+ require 'yard'
7
+ YARD::Rake::YardocTask.new
8
+
9
+ begin
10
+ require 'rspec/core/rake_task'
11
+
12
+ rspec_task = RSpec::Core::RakeTask.new(:spec)
13
+
14
+ task :default => :spec
15
+
16
+ namespace :doc do
17
+ desc 'Generate Markdown Specification from the RSpec public API tests'
18
+ task :spec do
19
+ ENV['TEST_LIMIT_PROTOCOLS'] = JSON.dump({ msgpack: 'JSON and MsgPack' })
20
+
21
+ rspec_task.rspec_opts = %w(
22
+ --require ./spec/support/markdown_spec_formatter
23
+ --order defined
24
+ --tag ~api_private
25
+ --format documentation
26
+ --format Ably::RSpec::MarkdownSpecFormatter
27
+ ).join(' ')
28
+
29
+ Rake::Task[:spec].invoke
30
+ end
31
+ end
32
+ rescue LoadError
33
+ # RSpec not available
34
+ end
@@ -0,0 +1,1794 @@
1
+ # Ably Real-time & REST Client Library 0.7.1 Specification
2
+
3
+ ### Ably::Realtime::Channel#history
4
+ _(see [spec/acceptance/realtime/channel_history_spec.rb](./spec/acceptance/realtime/channel_history_spec.rb))_
5
+ * using JSON and MsgPack protocol
6
+ * [returns a Deferrable](./spec/acceptance/realtime/channel_history_spec.rb#L20)
7
+ * with a single client publishing and receiving
8
+ * [retrieves real-time history](./spec/acceptance/realtime/channel_history_spec.rb#L33)
9
+ * with two clients publishing messages on the same channel
10
+ * [retrieves real-time history on both channels](./spec/acceptance/realtime/channel_history_spec.rb#L45)
11
+ * with lots of messages published with a single client and channel
12
+ * as one ProtocolMessage
13
+ * [retrieves history forwards with pagination through :limit option](./spec/acceptance/realtime/channel_history_spec.rb#L87)
14
+ * [retrieves history backwards with pagination through :limit option](./spec/acceptance/realtime/channel_history_spec.rb#L96)
15
+ * in multiple ProtocolMessages
16
+ * [retrieves limited history forwards with pagination](./spec/acceptance/realtime/channel_history_spec.rb#L107)
17
+ * [retrieves limited history backwards with pagination](./spec/acceptance/realtime/channel_history_spec.rb#L118)
18
+ * and REST history
19
+ * [return the same results with unique matching message IDs](./spec/acceptance/realtime/channel_history_spec.rb#L134)
20
+
21
+ ### Ably::Realtime::Channel
22
+ _(see [spec/acceptance/realtime/channel_spec.rb](./spec/acceptance/realtime/channel_spec.rb))_
23
+ * using JSON and MsgPack protocol
24
+ * initialization
25
+ * with :connect_automatically option set to false on connection
26
+ * [remains initialized when accessing a channel](./spec/acceptance/realtime/channel_spec.rb#L21)
27
+ * [opens a connection implicitly on #attach](./spec/acceptance/realtime/channel_spec.rb#L29)
28
+ * [opens a connection implicitly when accessing #presence](./spec/acceptance/realtime/channel_spec.rb#L36)
29
+ * #attach
30
+ * [emits attaching then attached events](./spec/acceptance/realtime/channel_spec.rb#L49)
31
+ * [ignores subsequent #attach calls but calls the success callback if provided](./spec/acceptance/realtime/channel_spec.rb#L59)
32
+ * [attaches to a channel](./spec/acceptance/realtime/channel_spec.rb#L72)
33
+ * [attaches to a channel and calls the provided block](./spec/acceptance/realtime/channel_spec.rb#L80)
34
+ * [returns a Deferrable](./spec/acceptance/realtime/channel_spec.rb#L87)
35
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/channel_spec.rb#L92)
36
+ * when state is :failed
37
+ * [reattaches](./spec/acceptance/realtime/channel_spec.rb#L103)
38
+ * when state is :detaching
39
+ * [moves straight to attaching and skips detached](./spec/acceptance/realtime/channel_spec.rb#L116)
40
+ * with many connections and many channels on each simultaneously
41
+ * [attaches all channels](./spec/acceptance/realtime/channel_spec.rb#L142)
42
+ * failure as a result of insufficient key permissions
43
+ * [triggers failed event](./spec/acceptance/realtime/channel_spec.rb#L165)
44
+ * [calls the errback of the returned Deferrable](./spec/acceptance/realtime/channel_spec.rb#L174)
45
+ * [triggers an error event](./spec/acceptance/realtime/channel_spec.rb#L182)
46
+ * [updates the error_reason](./spec/acceptance/realtime/channel_spec.rb#L191)
47
+ * #detach
48
+ * [detaches from a channel](./spec/acceptance/realtime/channel_spec.rb#L202)
49
+ * [detaches from a channel and calls the provided block](./spec/acceptance/realtime/channel_spec.rb#L212)
50
+ * [emits :detaching then :detached events](./spec/acceptance/realtime/channel_spec.rb#L221)
51
+ * [returns a Deferrable](./spec/acceptance/realtime/channel_spec.rb#L233)
52
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/channel_spec.rb#L238)
53
+ * when state is :failed
54
+ * [raises an exception](./spec/acceptance/realtime/channel_spec.rb#L251)
55
+ * when state is :attaching
56
+ * [moves straight to :detaching state and skips :attached](./spec/acceptance/realtime/channel_spec.rb#L262)
57
+ * when state is :detaching
58
+ * [ignores subsequent #detach calls but calls the callback if provided](./spec/acceptance/realtime/channel_spec.rb#L280)
59
+ * channel recovery in :attaching state
60
+ * the transport is disconnected before the ATTACHED protocol message is received
61
+ * PENDING: *[attach times out and fails if not ATTACHED protocol message received](./spec/acceptance/realtime/channel_spec.rb#L299)*
62
+ * PENDING: *[channel is ATTACHED if ATTACHED protocol message is later received](./spec/acceptance/realtime/channel_spec.rb#L300)*
63
+ * PENDING: *[sends an ATTACH protocol message in response to a channel message being received on the attaching channel](./spec/acceptance/realtime/channel_spec.rb#L301)*
64
+ * #publish
65
+ * when attached
66
+ * [publishes messages](./spec/acceptance/realtime/channel_spec.rb#L307)
67
+ * when not yet attached
68
+ * [publishes queued messages once attached](./spec/acceptance/realtime/channel_spec.rb#L319)
69
+ * [publishes queued messages within a single protocol message](./spec/acceptance/realtime/channel_spec.rb#L327)
70
+ * #subscribe
71
+ * with an event argument
72
+ * [subscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L350)
73
+ * with no event argument
74
+ * [subscribes for all events](./spec/acceptance/realtime/channel_spec.rb#L360)
75
+ * many times with different event names
76
+ * [filters events accordingly to each callback](./spec/acceptance/realtime/channel_spec.rb#L370)
77
+ * #unsubscribe
78
+ * with an event argument
79
+ * [unsubscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L393)
80
+ * with no event argument
81
+ * [unsubscribes for a single event](./spec/acceptance/realtime/channel_spec.rb#L406)
82
+ * when connection state changes to
83
+ * :failed
84
+ * an :attached channel
85
+ * [transitions state to :failed](./spec/acceptance/realtime/channel_spec.rb#L429)
86
+ * [triggers an error event on the channel](./spec/acceptance/realtime/channel_spec.rb#L439)
87
+ * [updates the channel error_reason](./spec/acceptance/realtime/channel_spec.rb#L449)
88
+ * a :detached channel
89
+ * [remains in the :detached state](./spec/acceptance/realtime/channel_spec.rb#L461)
90
+ * a :failed channel
91
+ * [remains in the :failed state and ignores the failure error](./spec/acceptance/realtime/channel_spec.rb#L481)
92
+ * :closed
93
+ * an :attached channel
94
+ * [transitions state to :detached](./spec/acceptance/realtime/channel_spec.rb#L504)
95
+ * a :detached channel
96
+ * [remains in the :detached state](./spec/acceptance/realtime/channel_spec.rb#L515)
97
+ * a :failed channel
98
+ * [remains in the :failed state and retains the error_reason](./spec/acceptance/realtime/channel_spec.rb#L536)
99
+
100
+ ### Ably::Realtime::Client
101
+ _(see [spec/acceptance/realtime/client_spec.rb](./spec/acceptance/realtime/client_spec.rb))_
102
+ * using JSON and MsgPack protocol
103
+ * initialization
104
+ * basic auth
105
+ * [is enabled by default with a provided :api_key option](./spec/acceptance/realtime/client_spec.rb#L18)
106
+ * :tls option
107
+ * set to false to forec a plain-text connection
108
+ * [fails to connect because a private key cannot be sent over a non-secure connection](./spec/acceptance/realtime/client_spec.rb#L31)
109
+ * token auth
110
+ * with TLS enabled
111
+ * and a pre-generated Token provided with the :token_id option
112
+ * [connects using token auth](./spec/acceptance/realtime/client_spec.rb#L51)
113
+ * with valid :api_key and :use_token_auth option set to true
114
+ * [automatically authorises on connect and generates a token](./spec/acceptance/realtime/client_spec.rb#L64)
115
+ * with client_id
116
+ * [connects using token auth](./spec/acceptance/realtime/client_spec.rb#L77)
117
+ * with TLS disabled
118
+ * and a pre-generated Token provided with the :token_id option
119
+ * [connects using token auth](./spec/acceptance/realtime/client_spec.rb#L51)
120
+ * with valid :api_key and :use_token_auth option set to true
121
+ * [automatically authorises on connect and generates a token](./spec/acceptance/realtime/client_spec.rb#L64)
122
+ * with client_id
123
+ * [connects using token auth](./spec/acceptance/realtime/client_spec.rb#L77)
124
+ * with token_request_block
125
+ * [calls the block](./spec/acceptance/realtime/client_spec.rb#L102)
126
+ * [uses the token request when requesting a new token](./spec/acceptance/realtime/client_spec.rb#L109)
127
+
128
+ ### Ably::Realtime::Connection failures
129
+ _(see [spec/acceptance/realtime/connection_failures_spec.rb](./spec/acceptance/realtime/connection_failures_spec.rb))_
130
+ * using JSON and MsgPack protocol
131
+ * authentication failure
132
+ * when API key is invalid
133
+ * with invalid app part of the key
134
+ * [enters the failed state and returns a not found error](./spec/acceptance/realtime/connection_failures_spec.rb#L26)
135
+ * with invalid key ID part of the key
136
+ * [enters the failed state and returns an authorization error](./spec/acceptance/realtime/connection_failures_spec.rb#L40)
137
+ * automatic connection retry
138
+ * with invalid WebSocket host
139
+ * when disconnected
140
+ * [enters the suspended state after multiple attempts to connect](./spec/acceptance/realtime/connection_failures_spec.rb#L94)
141
+ * #close
142
+ * [transitions connection state to :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L111)
143
+ * when connection state is :suspended
144
+ * [enters the failed state after multiple attempts](./spec/acceptance/realtime/connection_failures_spec.rb#L130)
145
+ * #close
146
+ * [transitions connection state to :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L150)
147
+ * when connection state is :failed
148
+ * #close
149
+ * [will not transition state to :close and raises a StateChangeError exception](./spec/acceptance/realtime/connection_failures_spec.rb#L169)
150
+ * #error_reason
151
+ * [contains the error when state is disconnected](./spec/acceptance/realtime/connection_failures_spec.rb#L183)
152
+ * [contains the error when state is suspended](./spec/acceptance/realtime/connection_failures_spec.rb#L183)
153
+ * [contains the error when state is failed](./spec/acceptance/realtime/connection_failures_spec.rb#L183)
154
+ * [is reset to nil when :connected](./spec/acceptance/realtime/connection_failures_spec.rb#L192)
155
+ * [is reset to nil when :closed](./spec/acceptance/realtime/connection_failures_spec.rb#L203)
156
+ * #connect
157
+ * connection opening times out
158
+ * [attempts to reconnect](./spec/acceptance/realtime/connection_failures_spec.rb#L230)
159
+ * [calls the errback of the returned Deferrable object when first connection attempt fails](./spec/acceptance/realtime/connection_failures_spec.rb#L243)
160
+ * when retry intervals are stubbed to attempt reconnection quickly
161
+ * [never calls the provided success block](./spec/acceptance/realtime/connection_failures_spec.rb#L262)
162
+ * connection resume
163
+ * when DISCONNECTED ProtocolMessage received from the server
164
+ * [reconnects automatically](./spec/acceptance/realtime/connection_failures_spec.rb#L291)
165
+ * when websocket transport is closed
166
+ * [reconnects automatically](./spec/acceptance/realtime/connection_failures_spec.rb#L309)
167
+ * after successfully reconnecting and resuming
168
+ * [retains connection_id and connection_key](./spec/acceptance/realtime/connection_failures_spec.rb#L326)
169
+ * [retains channel subscription state](./spec/acceptance/realtime/connection_failures_spec.rb#L343)
170
+ * when messages were published whilst the client was disconnected
171
+ * [receives the messages published whilst offline](./spec/acceptance/realtime/connection_failures_spec.rb#L363)
172
+ * when failing to resume because the connection_key is not or no longer valid
173
+ * [updates the connection_id and connection_key](./spec/acceptance/realtime/connection_failures_spec.rb#L403)
174
+ * [detaches all channels](./spec/acceptance/realtime/connection_failures_spec.rb#L418)
175
+ * [emits an error on the channel and sets the error reason](./spec/acceptance/realtime/connection_failures_spec.rb#L436)
176
+ * fallback host feature
177
+ * with custom realtime websocket host option
178
+ * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L472)
179
+ * with non-production environment
180
+ * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L489)
181
+ * with production environment
182
+ * when the Internet is down
183
+ * [never uses a fallback host](./spec/acceptance/realtime/connection_failures_spec.rb#L517)
184
+ * when the Internet is up
185
+ * [uses a fallback host on every subsequent disconnected attempt until suspended](./spec/acceptance/realtime/connection_failures_spec.rb#L534)
186
+ * [uses the primary host when suspended, and a fallback host on every subsequent suspended attempt](./spec/acceptance/realtime/connection_failures_spec.rb#L553)
187
+
188
+ ### Ably::Realtime::Connection
189
+ _(see [spec/acceptance/realtime/connection_spec.rb](./spec/acceptance/realtime/connection_spec.rb))_
190
+ * using JSON and MsgPack protocol
191
+ * intialization
192
+ * [connects automatically](./spec/acceptance/realtime/connection_spec.rb#L22)
193
+ * with :connect_automatically option set to false
194
+ * [does not connect automatically](./spec/acceptance/realtime/connection_spec.rb#L34)
195
+ * [connects when method #connect is called](./spec/acceptance/realtime/connection_spec.rb#L42)
196
+ * with token auth
197
+ * for renewable tokens
198
+ * that are valid for the duration of the test
199
+ * with valid pre authorised token expiring in the future
200
+ * [uses the existing token created by Auth](./spec/acceptance/realtime/connection_spec.rb#L60)
201
+ * with implicit authorisation
202
+ * [uses the token created by the implicit authorisation](./spec/acceptance/realtime/connection_spec.rb#L72)
203
+ * that expire
204
+ * opening a new connection
205
+ * with recently expired token
206
+ * [renews the token on connect](./spec/acceptance/realtime/connection_spec.rb#L93)
207
+ * with immediately expiring token
208
+ * [renews the token on connect, and only makes one subsequent attempt to obtain a new token](./spec/acceptance/realtime/connection_spec.rb#L107)
209
+ * [uses the primary host for subsequent connection and auth requests](./spec/acceptance/realtime/connection_spec.rb#L117)
210
+ * when connected with a valid non-expired token
211
+ * that then expires following the connection being opened
212
+ * PENDING: *[retains connection state](./spec/acceptance/realtime/connection_spec.rb#L167)*
213
+ * PENDING: *[changes state to failed if a new token cannot be issued](./spec/acceptance/realtime/connection_spec.rb#L168)*
214
+ * the server
215
+ * [disconnects the client, and the client automatically renews the token and then reconnects](./spec/acceptance/realtime/connection_spec.rb#L144)
216
+ * for non-renewable tokens
217
+ * that are expired
218
+ * opening a new connection
219
+ * [transitions state to failed](./spec/acceptance/realtime/connection_spec.rb#L183)
220
+ * when connected
221
+ * PENDING: *[transitions state to failed](./spec/acceptance/realtime/connection_spec.rb#L196)*
222
+ * initialization state changes
223
+ * with implicit #connect
224
+ * [are triggered in order](./spec/acceptance/realtime/connection_spec.rb#L223)
225
+ * with explicit #connect
226
+ * [are triggered in order](./spec/acceptance/realtime/connection_spec.rb#L229)
227
+ * #connect
228
+ * [returns a Deferrable](./spec/acceptance/realtime/connection_spec.rb#L237)
229
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/connection_spec.rb#L242)
230
+ * when already connected
231
+ * [does nothing and no further state changes are emitted](./spec/acceptance/realtime/connection_spec.rb#L251)
232
+ * once connected
233
+ * connection#id
234
+ * [is a string](./spec/acceptance/realtime/connection_spec.rb#L268)
235
+ * [is unique from the connection#key](./spec/acceptance/realtime/connection_spec.rb#L275)
236
+ * [is unique for every connection](./spec/acceptance/realtime/connection_spec.rb#L282)
237
+ * connection#key
238
+ * [is a string](./spec/acceptance/realtime/connection_spec.rb#L291)
239
+ * [is unique from the connection#id](./spec/acceptance/realtime/connection_spec.rb#L298)
240
+ * [is unique for every connection](./spec/acceptance/realtime/connection_spec.rb#L305)
241
+ * following a previous connection being opened and closed
242
+ * [reconnects and is provided with a new connection ID and connection key from the server](./spec/acceptance/realtime/connection_spec.rb#L315)
243
+ * #serial connection serial
244
+ * [is set to -1 when a new connection is opened](./spec/acceptance/realtime/connection_spec.rb#L335)
245
+ * [is set to 0 when a message sent ACK is received](./spec/acceptance/realtime/connection_spec.rb#L357)
246
+ * [is set to 1 when the second message sent ACK is received](./spec/acceptance/realtime/connection_spec.rb#L364)
247
+ * when a message is sent but the ACK has not yet been received
248
+ * [the sent message msgSerial is 0 but the connection serial remains at -1](./spec/acceptance/realtime/connection_spec.rb#L344)
249
+ * #close
250
+ * [returns a Deferrable](./spec/acceptance/realtime/connection_spec.rb#L375)
251
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/connection_spec.rb#L382)
252
+ * when already closed
253
+ * [does nothing and no further state changes are emitted](./spec/acceptance/realtime/connection_spec.rb#L393)
254
+ * when connection state is
255
+ * :initialized
256
+ * [changes the connection state to :closing and then immediately :closed without sending a ProtocolMessage CLOSE](./spec/acceptance/realtime/connection_spec.rb#L421)
257
+ * :connected
258
+ * [changes the connection state to :closing and waits for the server to confirm connection is :closed with a ProtocolMessage](./spec/acceptance/realtime/connection_spec.rb#L439)
259
+ * with an unresponsive connection
260
+ * [force closes the connection when a :closed ProtocolMessage response is not received](./spec/acceptance/realtime/connection_spec.rb#L469)
261
+ * #ping
262
+ * [echoes a heart beat](./spec/acceptance/realtime/connection_spec.rb#L492)
263
+ * when not connected
264
+ * [raises an exception](./spec/acceptance/realtime/connection_spec.rb#L502)
265
+ * recovery
266
+ * #recovery_key
267
+ * [is composed of connection id and serial that is kept up to date with each message ACK received](./spec/acceptance/realtime/connection_spec.rb#L535)
268
+ * [is available when connection is in one of the states: connecting, connected, disconnected, suspended, failed](./spec/acceptance/realtime/connection_spec.rb#L556)
269
+ * [is nil when connection is explicitly CLOSED](./spec/acceptance/realtime/connection_spec.rb#L580)
270
+ * opening a new connection using a recently disconnected connection's #recovery_key
271
+ * connection#id and connection#key after recovery
272
+ * [remain the same](./spec/acceptance/realtime/connection_spec.rb#L594)
273
+ * when messages have been sent whilst the old connection is disconnected
274
+ * the new connection
275
+ * [recovers server-side queued messages](./spec/acceptance/realtime/connection_spec.rb#L619)
276
+ * with :recover option
277
+ * with invalid syntax
278
+ * [raises an exception](./spec/acceptance/realtime/connection_spec.rb#L644)
279
+ * with invalid formatted value sent to server
280
+ * [triggers a fatal error on the connection object, sets the #error_reason and disconnects](./spec/acceptance/realtime/connection_spec.rb#L653)
281
+ * with expired (missing) value sent to server
282
+ * [triggers an error on the connection object, sets the #error_reason, yet will connect anyway](./spec/acceptance/realtime/connection_spec.rb#L667)
283
+ * with many connections simultaneously
284
+ * [opens each with a unique connection#id and connection#key](./spec/acceptance/realtime/connection_spec.rb#L685)
285
+ * when a state transition is unsupported
286
+ * [emits a StateChangeError](./spec/acceptance/realtime/connection_spec.rb#L705)
287
+ * undocumented method
288
+ * #internet_up?
289
+ * [returns a Deferrable](./spec/acceptance/realtime/connection_spec.rb#L720)
290
+ * when the Internet is up
291
+ * [calls the block with true](./spec/acceptance/realtime/connection_spec.rb#L726)
292
+ * [calls the success callback of the Deferrable](./spec/acceptance/realtime/connection_spec.rb#L733)
293
+ * when the Internet is down
294
+ * [calls the block with false](./spec/acceptance/realtime/connection_spec.rb#L745)
295
+ * [calls the failure callback of the Deferrable](./spec/acceptance/realtime/connection_spec.rb#L752)
296
+
297
+ ### Ably::Realtime::Channel Message
298
+ _(see [spec/acceptance/realtime/message_spec.rb](./spec/acceptance/realtime/message_spec.rb))_
299
+ * using JSON and MsgPack protocol
300
+ * [sends a String data payload](./spec/acceptance/realtime/message_spec.rb#L25)
301
+ * with ASCII_8BIT message name
302
+ * [is converted into UTF_8](./spec/acceptance/realtime/message_spec.rb#L37)
303
+ * when the message publisher has a client_id
304
+ * [contains a #client_id attribute](./spec/acceptance/realtime/message_spec.rb#L53)
305
+ * #connection_id attribute
306
+ * over realtime
307
+ * [matches the sender connection#id](./spec/acceptance/realtime/message_spec.rb#L66)
308
+ * when retrieved over REST
309
+ * [matches the sender connection#id](./spec/acceptance/realtime/message_spec.rb#L78)
310
+ * local echo when published
311
+ * [is enabled by default](./spec/acceptance/realtime/message_spec.rb#L90)
312
+ * with :echo_messages option set to false
313
+ * [will not echo messages to the client but will still broadcast messages to other connected clients](./spec/acceptance/realtime/message_spec.rb#L106)
314
+ * publishing lots of messages across two connections
315
+ * [sends and receives the messages on both opened connections and calls the success callbacks for each message published](./spec/acceptance/realtime/message_spec.rb#L138)
316
+ * without suitable publishing permissions
317
+ * [calls the error callback](./spec/acceptance/realtime/message_spec.rb#L183)
318
+ * encoding and decoding encrypted messages
319
+ * with AES-128-CBC using crypto-data-128.json fixtures
320
+ * item 0 with encrypted encoding utf-8/cipher+aes-128-cbc/base64
321
+ * behaves like an Ably encrypter and decrypter
322
+ * with #publish and #subscribe
323
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
324
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
325
+ * item 1 with encrypted encoding cipher+aes-128-cbc/base64
326
+ * behaves like an Ably encrypter and decrypter
327
+ * with #publish and #subscribe
328
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
329
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
330
+ * item 2 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
331
+ * behaves like an Ably encrypter and decrypter
332
+ * with #publish and #subscribe
333
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
334
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
335
+ * item 3 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
336
+ * behaves like an Ably encrypter and decrypter
337
+ * with #publish and #subscribe
338
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
339
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
340
+ * with AES-256-CBC using crypto-data-256.json fixtures
341
+ * item 0 with encrypted encoding utf-8/cipher+aes-256-cbc/base64
342
+ * behaves like an Ably encrypter and decrypter
343
+ * with #publish and #subscribe
344
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
345
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
346
+ * item 1 with encrypted encoding cipher+aes-256-cbc/base64
347
+ * behaves like an Ably encrypter and decrypter
348
+ * with #publish and #subscribe
349
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
350
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
351
+ * item 2 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
352
+ * behaves like an Ably encrypter and decrypter
353
+ * with #publish and #subscribe
354
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
355
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
356
+ * item 3 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
357
+ * behaves like an Ably encrypter and decrypter
358
+ * with #publish and #subscribe
359
+ * [encrypts message automatically before they are pushed to the server](./spec/acceptance/realtime/message_spec.rb#L235)
360
+ * [sends and receives messages that are encrypted & decrypted by the Ably library](./spec/acceptance/realtime/message_spec.rb#L253)
361
+ * with multiple sends from one client to another
362
+ * [encrypts and decrypts all messages](./spec/acceptance/realtime/message_spec.rb#L292)
363
+ * subscribing with a different transport protocol
364
+ * [delivers a String ASCII-8BIT payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L335)
365
+ * [delivers a String UTF-8 payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L335)
366
+ * [delivers a Hash payload to the receiver](./spec/acceptance/realtime/message_spec.rb#L335)
367
+ * publishing on an unencrypted channel and subscribing on an encrypted channel with another client
368
+ * [does not attempt to decrypt the message](./spec/acceptance/realtime/message_spec.rb#L354)
369
+ * publishing on an encrypted channel and subscribing on an unencrypted channel with another client
370
+ * [delivers the message but still encrypted with a value in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L372)
371
+ * [triggers a Cipher error on the channel](./spec/acceptance/realtime/message_spec.rb#L381)
372
+ * publishing on an encrypted channel and subscribing with a different algorithm on another client
373
+ * [delivers the message but still encrypted with the cipher detials in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L403)
374
+ * [triggers a Cipher error on the channel](./spec/acceptance/realtime/message_spec.rb#L412)
375
+ * publishing on an encrypted channel and subscribing with a different key on another client
376
+ * [delivers the message but still encrypted with the cipher details in the #encoding attribute](./spec/acceptance/realtime/message_spec.rb#L434)
377
+ * [triggers a Cipher error on the channel](./spec/acceptance/realtime/message_spec.rb#L443)
378
+
379
+ ### Ably::Realtime::Presence history
380
+ _(see [spec/acceptance/realtime/presence_history_spec.rb](./spec/acceptance/realtime/presence_history_spec.rb))_
381
+ * using JSON and MsgPack protocol
382
+ * [provides up to the moment presence history](./spec/acceptance/realtime/presence_history_spec.rb#L21)
383
+ * [ensures REST presence history message IDs match ProtocolMessage wrapped message and connection IDs via Realtime](./spec/acceptance/realtime/presence_history_spec.rb#L41)
384
+
385
+ ### Ably::Realtime::Presence
386
+ _(see [spec/acceptance/realtime/presence_spec.rb](./spec/acceptance/realtime/presence_spec.rb))_
387
+ * using JSON and MsgPack protocol
388
+ * PENDING: *[ensure connection_id is unique and updated on ENTER](./spec/acceptance/realtime/presence_spec.rb#L995)*
389
+ * PENDING: *[ensure connection_id for presence member matches the messages they publish on the channel](./spec/acceptance/realtime/presence_spec.rb#L996)*
390
+ * PENDING: *[stop a call to get when the channel has not been entered](./spec/acceptance/realtime/presence_spec.rb#L997)*
391
+ * PENDING: *[stop a call to get when the channel has been entered but the list is not up to date](./spec/acceptance/realtime/presence_spec.rb#L998)*
392
+ * PENDING: *[presence will resume sync if connection is dropped mid-way](./spec/acceptance/realtime/presence_spec.rb#L999)*
393
+ * when attached (but not present) on a presence channel with an anonymous client (no client ID)
394
+ * [maintains state as other clients enter and leave the channel](./spec/acceptance/realtime/presence_spec.rb#L24)
395
+ * #sync_complete?
396
+ * when attaching to a channel without any members present
397
+ * [is true and the presence channel is considered synced immediately](./spec/acceptance/realtime/presence_spec.rb#L53)
398
+ * when attaching to a channel with members present
399
+ * [is false and the presence channel will subsequently be synced](./spec/acceptance/realtime/presence_spec.rb#L62)
400
+ * when the SYNC of a presence channel spans multiple ProtocolMessage messages
401
+ * with 250 existing (present) members
402
+ * when a new client attaches to the presence channel
403
+ * [emits :present for each member](./spec/acceptance/realtime/presence_spec.rb#L83)
404
+ * #get
405
+ * [#waits until sync is complete](./spec/acceptance/realtime/presence_spec.rb#L102)
406
+ * automatic attachment of channel on access to presence object
407
+ * [is implicit if presence state is initalized](./spec/acceptance/realtime/presence_spec.rb#L122)
408
+ * [is disabled if presence state is not initialized](./spec/acceptance/realtime/presence_spec.rb#L130)
409
+ * state
410
+ * once opened
411
+ * [once opened, enters the :left state if the channel detaches](./spec/acceptance/realtime/presence_spec.rb#L147)
412
+ * #enter
413
+ * [allows client_id to be set on enter for anonymous clients](./spec/acceptance/realtime/presence_spec.rb#L170)
414
+ * [raises an exception if client_id is not set](./spec/acceptance/realtime/presence_spec.rb#L204)
415
+ * [returns a Deferrable](./spec/acceptance/realtime/presence_spec.rb#L209)
416
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L214)
417
+ * data attribute
418
+ * when provided as argument option to #enter
419
+ * [remains intact following #leave](./spec/acceptance/realtime/presence_spec.rb#L181)
420
+ * #update
421
+ * [without previous #enter automatically enters](./spec/acceptance/realtime/presence_spec.rb#L224)
422
+ * [updates the data if :data argument provided](./spec/acceptance/realtime/presence_spec.rb#L249)
423
+ * [updates the data to nil if :data argument is not provided (assumes nil value)](./spec/acceptance/realtime/presence_spec.rb#L259)
424
+ * [returns a Deferrable](./spec/acceptance/realtime/presence_spec.rb#L269)
425
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L276)
426
+ * when ENTERED
427
+ * [has no effect on the state](./spec/acceptance/realtime/presence_spec.rb#L234)
428
+ * #leave
429
+ * [raises an exception if not entered](./spec/acceptance/realtime/presence_spec.rb#L332)
430
+ * [returns a Deferrable](./spec/acceptance/realtime/presence_spec.rb#L337)
431
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L344)
432
+ * :data option
433
+ * when set to a string
434
+ * [emits the new data for the leave event](./spec/acceptance/realtime/presence_spec.rb#L293)
435
+ * when set to nil
436
+ * [emits the previously defined value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L306)
437
+ * when not passed as an argument
438
+ * [emits the previously defined value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L319)
439
+ * :left event
440
+ * [emits the data defined in enter](./spec/acceptance/realtime/presence_spec.rb#L356)
441
+ * [emits the data defined in update](./spec/acceptance/realtime/presence_spec.rb#L367)
442
+ * entering/updating/leaving presence state on behalf of another client_id
443
+ * #enter_client
444
+ * [returns a Deferrable](./spec/acceptance/realtime/presence_spec.rb#L418)
445
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L423)
446
+ * multiple times on the same channel with different client_ids
447
+ * [has no affect on the client's presence state and only enters on behalf of the provided client_id](./spec/acceptance/realtime/presence_spec.rb#L388)
448
+ * [enters a channel and sets the data based on the provided :data option](./spec/acceptance/realtime/presence_spec.rb#L402)
449
+ * #update_client
450
+ * [returns a Deferrable](./spec/acceptance/realtime/presence_spec.rb#L492)
451
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L497)
452
+ * multiple times on the same channel with different client_ids
453
+ * [updates the data attribute for the member when :data option provided](./spec/acceptance/realtime/presence_spec.rb#L433)
454
+ * [updates the data attribute to null for the member when :data option is not provided (assumed null)](./spec/acceptance/realtime/presence_spec.rb#L457)
455
+ * [enters if not already entered](./spec/acceptance/realtime/presence_spec.rb#L469)
456
+ * #leave_client
457
+ * [returns a Deferrable](./spec/acceptance/realtime/presence_spec.rb#L595)
458
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L600)
459
+ * leaves a channel
460
+ * multiple times on the same channel with different client_ids
461
+ * [emits the :leave event for each client_id](./spec/acceptance/realtime/presence_spec.rb#L508)
462
+ * [succeeds if that client_id has not previously entered the channel](./spec/acceptance/realtime/presence_spec.rb#L532)
463
+ * with a new value in :data option
464
+ * [emits the leave event with the new data value](./spec/acceptance/realtime/presence_spec.rb#L556)
465
+ * with a nil value in :data option
466
+ * [emits the leave event with the previous value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L569)
467
+ * with no :data option
468
+ * [emits the leave event with the previous value as a convenience](./spec/acceptance/realtime/presence_spec.rb#L582)
469
+ * #get
470
+ * [returns a Deferrable](./spec/acceptance/realtime/presence_spec.rb#L610)
471
+ * [calls the Deferrable callback on success](./spec/acceptance/realtime/presence_spec.rb#L615)
472
+ * [returns the current members on the channel](./spec/acceptance/realtime/presence_spec.rb#L622)
473
+ * [filters by connection_id option if provided](./spec/acceptance/realtime/presence_spec.rb#L637)
474
+ * [filters by client_id option if provided](./spec/acceptance/realtime/presence_spec.rb#L659)
475
+ * [does not wait for SYNC to complete if :wait_for_sync option is false](./spec/acceptance/realtime/presence_spec.rb#L683)
476
+ * when a member enters and then leaves
477
+ * [has no members](./spec/acceptance/realtime/presence_spec.rb#L693)
478
+ * with lots of members on different clients
479
+ * [returns a complete list of members on all clients](./spec/acceptance/realtime/presence_spec.rb#L710)
480
+ * #subscribe
481
+ * with no arguments
482
+ * [calls the callback for all presence events](./spec/acceptance/realtime/presence_spec.rb#L746)
483
+ * #unsubscribe
484
+ * with no arguments
485
+ * [removes the callback for all presence events](./spec/acceptance/realtime/presence_spec.rb#L766)
486
+ * REST #get
487
+ * [returns current members](./spec/acceptance/realtime/presence_spec.rb#L785)
488
+ * [returns no members once left](./spec/acceptance/realtime/presence_spec.rb#L798)
489
+ * client_id with ASCII_8BIT
490
+ * in connection set up
491
+ * [is converted into UTF_8](./spec/acceptance/realtime/presence_spec.rb#L815)
492
+ * in channel options
493
+ * [is converted into UTF_8](./spec/acceptance/realtime/presence_spec.rb#L828)
494
+ * encoding and decoding of presence message data
495
+ * [encrypts presence message data](./spec/acceptance/realtime/presence_spec.rb#L852)
496
+ * #subscribe
497
+ * [emits decrypted enter events](./spec/acceptance/realtime/presence_spec.rb#L871)
498
+ * [emits decrypted update events](./spec/acceptance/realtime/presence_spec.rb#L883)
499
+ * [emits previously set data for leave events](./spec/acceptance/realtime/presence_spec.rb#L897)
500
+ * #get
501
+ * [returns a list of members with decrypted data](./spec/acceptance/realtime/presence_spec.rb#L913)
502
+ * REST #get
503
+ * [returns a list of members with decrypted data](./spec/acceptance/realtime/presence_spec.rb#L926)
504
+ * when cipher settings do not match publisher
505
+ * [delivers an unencoded presence message left with encoding value](./spec/acceptance/realtime/presence_spec.rb#L941)
506
+ * [emits an error when cipher does not match and presence data cannot be decoded](./spec/acceptance/realtime/presence_spec.rb#L954)
507
+ * leaving
508
+ * [expect :left event once underlying connection is closed](./spec/acceptance/realtime/presence_spec.rb#L971)
509
+ * [expect :left event with client data from enter event](./spec/acceptance/realtime/presence_spec.rb#L981)
510
+
511
+ ### Ably::Realtime::Client#stats
512
+ _(see [spec/acceptance/realtime/stats_spec.rb](./spec/acceptance/realtime/stats_spec.rb))_
513
+ * using JSON and MsgPack protocol
514
+ * fetching stats
515
+ * [should return a PaginatedResource](./spec/acceptance/realtime/stats_spec.rb#L10)
516
+ * [should return a Deferrable object](./spec/acceptance/realtime/stats_spec.rb#L17)
517
+
518
+ ### Ably::Realtime::Client#time
519
+ _(see [spec/acceptance/realtime/time_spec.rb](./spec/acceptance/realtime/time_spec.rb))_
520
+ * using JSON and MsgPack protocol
521
+ * fetching the service time
522
+ * [should return the service time as a Time object](./spec/acceptance/realtime/time_spec.rb#L10)
523
+ * [should return a deferrable object](./spec/acceptance/realtime/time_spec.rb#L19)
524
+
525
+ ### Ably::Auth
526
+ _(see [spec/acceptance/rest/auth_spec.rb](./spec/acceptance/rest/auth_spec.rb))_
527
+ * using JSON and MsgPack protocol
528
+ * [has immutable options](./spec/acceptance/rest/auth_spec.rb#L54)
529
+ * #request_token
530
+ * [returns the requested token](./spec/acceptance/rest/auth_spec.rb#L62)
531
+ * with option :client_id
532
+ * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L93)
533
+ * with option :capability
534
+ * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L93)
535
+ * with option :nonce
536
+ * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L93)
537
+ * with option :timestamp
538
+ * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L93)
539
+ * with option :ttl
540
+ * [overrides default and uses camelCase notation for all attributes](./spec/acceptance/rest/auth_spec.rb#L93)
541
+ * with :key_id & :key_secret options
542
+ * [key_id is used in request and signing uses key_secret](./spec/acceptance/rest/auth_spec.rb#L122)
543
+ * with :query_time option
544
+ * [queries the server for the time](./spec/acceptance/rest/auth_spec.rb#L130)
545
+ * without :query_time option
546
+ * [does not query the server for the time](./spec/acceptance/rest/auth_spec.rb#L139)
547
+ * with :auth_url option
548
+ * when response is valid
549
+ * [requests a token from :auth_url using an HTTP GET request](./spec/acceptance/rest/auth_spec.rb#L186)
550
+ * with :query_params
551
+ * [requests a token from :auth_url with the :query_params](./spec/acceptance/rest/auth_spec.rb#L194)
552
+ * with :headers
553
+ * [requests a token from :auth_url with the HTTP headers set](./spec/acceptance/rest/auth_spec.rb#L202)
554
+ * with POST
555
+ * [requests a token from :auth_url using an HTTP POST instead of the default GET](./spec/acceptance/rest/auth_spec.rb#L210)
556
+ * when response is invalid
557
+ * 500
558
+ * [raises ServerError](./spec/acceptance/rest/auth_spec.rb#L223)
559
+ * XML
560
+ * [raises InvalidResponseBody](./spec/acceptance/rest/auth_spec.rb#L234)
561
+ * with token_request_block
562
+ * [calls the block when authenticating to obtain the request token](./spec/acceptance/rest/auth_spec.rb#L252)
563
+ * [uses the token request from the block when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L257)
564
+ * before #authorise has been called
565
+ * [has no current_token](./spec/acceptance/rest/auth_spec.rb#L264)
566
+ * #authorise
567
+ * [updates the persisted auth options thare are then used for subsequent authorise requests](./spec/acceptance/rest/auth_spec.rb#L311)
568
+ * when called for the first time since the client has been instantiated
569
+ * [passes all options to #request_token](./spec/acceptance/rest/auth_spec.rb#L275)
570
+ * [returns a valid token](./spec/acceptance/rest/auth_spec.rb#L280)
571
+ * [issues a new token if option :force => true](./spec/acceptance/rest/auth_spec.rb#L284)
572
+ * with previous authorisation
573
+ * [does not request a token if current_token has not expired](./spec/acceptance/rest/auth_spec.rb#L295)
574
+ * [requests a new token if token is expired](./spec/acceptance/rest/auth_spec.rb#L300)
575
+ * [issues a new token if option :force => true](./spec/acceptance/rest/auth_spec.rb#L306)
576
+ * with token_request_block
577
+ * [calls the block](./spec/acceptance/rest/auth_spec.rb#L327)
578
+ * [uses the token request returned from the block when requesting a new token](./spec/acceptance/rest/auth_spec.rb#L331)
579
+ * for every subsequent #request_token
580
+ * without a provided block
581
+ * [calls the originally provided block](./spec/acceptance/rest/auth_spec.rb#L337)
582
+ * with a provided block
583
+ * [does not call the originally provided block and calls the new #request_token block](./spec/acceptance/rest/auth_spec.rb#L344)
584
+ * #create_token_request
585
+ * [uses the key ID from the client](./spec/acceptance/rest/auth_spec.rb#L360)
586
+ * [uses the default TTL](./spec/acceptance/rest/auth_spec.rb#L364)
587
+ * [uses the default capability](./spec/acceptance/rest/auth_spec.rb#L368)
588
+ * the nonce
589
+ * [is unique for every request](./spec/acceptance/rest/auth_spec.rb#L373)
590
+ * [is at least 16 characters](./spec/acceptance/rest/auth_spec.rb#L378)
591
+ * with option :ttl
592
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L389)
593
+ * with option :capability
594
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L389)
595
+ * with option :nonce
596
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L389)
597
+ * with option :timestamp
598
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L389)
599
+ * with option :client_id
600
+ * [overrides default](./spec/acceptance/rest/auth_spec.rb#L389)
601
+ * with additional invalid attributes
602
+ * [are ignored](./spec/acceptance/rest/auth_spec.rb#L397)
603
+ * when required fields are missing
604
+ * [should raise an exception if key secret is missing](./spec/acceptance/rest/auth_spec.rb#L408)
605
+ * [should raise an exception if key id is missing](./spec/acceptance/rest/auth_spec.rb#L412)
606
+ * with :query_time option
607
+ * [queries the server for the timestamp](./spec/acceptance/rest/auth_spec.rb#L421)
608
+ * with :timestamp option
609
+ * [uses the provided timestamp in the token request](./spec/acceptance/rest/auth_spec.rb#L431)
610
+ * signing
611
+ * [generates a valid HMAC](./spec/acceptance/rest/auth_spec.rb#L448)
612
+ * using token authentication
613
+ * with :token_id option
614
+ * [authenticates successfully using the provided :token_id](./spec/acceptance/rest/auth_spec.rb#L471)
615
+ * [disallows publishing on unspecified capability channels](./spec/acceptance/rest/auth_spec.rb#L475)
616
+ * [fails if timestamp is invalid](./spec/acceptance/rest/auth_spec.rb#L483)
617
+ * [cannot be renewed automatically](./spec/acceptance/rest/auth_spec.rb#L491)
618
+ * when implicit as a result of using :client id
619
+ * and requests to the Ably server are mocked
620
+ * [will send a token request to the server](./spec/acceptance/rest/auth_spec.rb#L521)
621
+ * a token is created
622
+ * [before a request is made](./spec/acceptance/rest/auth_spec.rb#L530)
623
+ * [when a message is published](./spec/acceptance/rest/auth_spec.rb#L534)
624
+ * [with capability and TTL defaults](./spec/acceptance/rest/auth_spec.rb#L538)
625
+ * when using an :api_key and basic auth
626
+ * [#using_token_auth? is false](./spec/acceptance/rest/auth_spec.rb#L553)
627
+ * [#using_basic_auth? is true](./spec/acceptance/rest/auth_spec.rb#L557)
628
+
629
+ ### Ably::Rest
630
+ _(see [spec/acceptance/rest/base_spec.rb](./spec/acceptance/rest/base_spec.rb))_
631
+ * transport protocol
632
+ * when protocol is not defined it defaults to :msgpack
633
+ * [uses MsgPack](./spec/acceptance/rest/base_spec.rb#L27)
634
+ * when option {:protocol=>:json} is used
635
+ * [uses JSON](./spec/acceptance/rest/base_spec.rb#L43)
636
+ * when option {:use_binary_protocol=>false} is used
637
+ * [uses JSON](./spec/acceptance/rest/base_spec.rb#L43)
638
+ * when option {:protocol=>:msgpack} is used
639
+ * [uses MsgPack](./spec/acceptance/rest/base_spec.rb#L60)
640
+ * when option {:use_binary_protocol=>true} is used
641
+ * [uses MsgPack](./spec/acceptance/rest/base_spec.rb#L60)
642
+ * using JSON and MsgPack protocol
643
+ * failed requests
644
+ * due to invalid Auth
645
+ * [should raise an InvalidRequest exception with a valid error message and code](./spec/acceptance/rest/base_spec.rb#L75)
646
+ * server error with JSON error response body
647
+ * [should raise a ServerError exception](./spec/acceptance/rest/base_spec.rb#L94)
648
+ * 500 server error without a valid JSON response body
649
+ * [should raise a ServerError exception](./spec/acceptance/rest/base_spec.rb#L105)
650
+ * token authentication failures
651
+ * when auth#token_renewable?
652
+ * [should automatically reissue a token](./spec/acceptance/rest/base_spec.rb#L143)
653
+ * when NOT auth#token_renewable?
654
+ * [should raise an InvalidToken exception](./spec/acceptance/rest/base_spec.rb#L156)
655
+
656
+ ### Ably::Rest::Channel
657
+ _(see [spec/acceptance/rest/channel_spec.rb](./spec/acceptance/rest/channel_spec.rb))_
658
+ * using JSON and MsgPack protocol
659
+ * #publish
660
+ * [should publish the message adn return true indicating success](./spec/acceptance/rest/channel_spec.rb#L17)
661
+ * #history
662
+ * [should return the current message history for the channel](./spec/acceptance/rest/channel_spec.rb#L39)
663
+ * [should return paged history using the PaginatedResource model](./spec/acceptance/rest/channel_spec.rb#L67)
664
+ * message timestamps
665
+ * [should all be after the messages were published](./spec/acceptance/rest/channel_spec.rb#L52)
666
+ * message IDs
667
+ * [should be unique](./spec/acceptance/rest/channel_spec.rb#L60)
668
+ * #history option
669
+ * :start
670
+ * with milliseconds since epoch value
671
+ * [uses this value in the history request](./spec/acceptance/rest/channel_spec.rb#L116)
672
+ * with a Time object value
673
+ * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/channel_spec.rb#L126)
674
+ * :end
675
+ * with milliseconds since epoch value
676
+ * [uses this value in the history request](./spec/acceptance/rest/channel_spec.rb#L116)
677
+ * with a Time object value
678
+ * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/channel_spec.rb#L126)
679
+
680
+ ### Ably::Rest::Channels
681
+ _(see [spec/acceptance/rest/channels_spec.rb](./spec/acceptance/rest/channels_spec.rb))_
682
+ * using JSON and MsgPack protocol
683
+ * using shortcut method #channel on the client object
684
+ * behaves like a channel
685
+ * [returns a channel object](./spec/acceptance/rest/channels_spec.rb#L6)
686
+ * [returns channel object and passes the provided options](./spec/acceptance/rest/channels_spec.rb#L11)
687
+ * using #get method on client#channels
688
+ * behaves like a channel
689
+ * [returns a channel object](./spec/acceptance/rest/channels_spec.rb#L6)
690
+ * [returns channel object and passes the provided options](./spec/acceptance/rest/channels_spec.rb#L11)
691
+ * using undocumented array accessor [] method on client#channels
692
+ * behaves like a channel
693
+ * [returns a channel object](./spec/acceptance/rest/channels_spec.rb#L6)
694
+ * [returns channel object and passes the provided options](./spec/acceptance/rest/channels_spec.rb#L11)
695
+
696
+ ### Ably::Rest::Client
697
+ _(see [spec/acceptance/rest/client_spec.rb](./spec/acceptance/rest/client_spec.rb))_
698
+ * using JSON and MsgPack protocol
699
+ * #initialize
700
+ * with an auth block
701
+ * [calls the block to get a new token](./spec/acceptance/rest/client_spec.rb#L20)
702
+ * with an auth URL
703
+ * [sends an HTTP request to the provided URL to get a new token](./spec/acceptance/rest/client_spec.rb#L34)
704
+ * using tokens
705
+ * when expired
706
+ * [creates a new token automatically when the old token expires](./spec/acceptance/rest/client_spec.rb#L55)
707
+ * when token has not expired
708
+ * [reuses the existing token for every request](./spec/acceptance/rest/client_spec.rb#L69)
709
+ * connection transport
710
+ * for default host
711
+ * [is configured to timeout connection opening in 4 seconds](./spec/acceptance/rest/client_spec.rb#L85)
712
+ * [is configured to timeout connection requests in 15 seconds](./spec/acceptance/rest/client_spec.rb#L89)
713
+ * for the fallback hosts
714
+ * [is configured to timeout connection opening in 4 seconds](./spec/acceptance/rest/client_spec.rb#L95)
715
+ * [is configured to timeout connection requests in 15 seconds](./spec/acceptance/rest/client_spec.rb#L99)
716
+ * fallback hosts
717
+ * configured
718
+ * [should make connection attempts to A.ably-realtime.com, B.ably-realtime.com, C.ably-realtime.com, D.ably-realtime.com, E.ably-realtime.com](./spec/acceptance/rest/client_spec.rb#L112)
719
+ * when environment is NOT production
720
+ * [does not retry failed requests with fallback hosts when there is a connection error](./spec/acceptance/rest/client_spec.rb#L129)
721
+ * when environment is production
722
+ * and connection times out
723
+ * [tries fallback hosts 3 times](./spec/acceptance/rest/client_spec.rb#L169)
724
+ * and the total request time exeeds 10 seconds
725
+ * [makes no further attempts to any fallback hosts](./spec/acceptance/rest/client_spec.rb#L184)
726
+ * and connection fails
727
+ * [tries fallback hosts 3 times](./spec/acceptance/rest/client_spec.rb#L200)
728
+ * with a custom host
729
+ * that does not exist
730
+ * [fails immediately and raises a Faraday Error](./spec/acceptance/rest/client_spec.rb#L216)
731
+ * fallback hosts
732
+ * [are never used](./spec/acceptance/rest/client_spec.rb#L237)
733
+ * that times out
734
+ * [fails immediately and raises a Faraday Error](./spec/acceptance/rest/client_spec.rb#L252)
735
+ * fallback hosts
736
+ * [are never used](./spec/acceptance/rest/client_spec.rb#L265)
737
+
738
+ ### Ably::Models::MessageEncoders
739
+ _(see [spec/acceptance/rest/encoders_spec.rb](./spec/acceptance/rest/encoders_spec.rb))_
740
+ * with binary transport protocol
741
+ * without encryption
742
+ * with UTF-8 data
743
+ * [does not apply any encoding](./spec/acceptance/rest/encoders_spec.rb#L41)
744
+ * with binary data
745
+ * [does not apply any encoding](./spec/acceptance/rest/encoders_spec.rb#L52)
746
+ * with JSON data
747
+ * [stringifies the JSON and sets the encoding attribute to "json"](./spec/acceptance/rest/encoders_spec.rb#L63)
748
+ * with encryption
749
+ * with UTF-8 data
750
+ * [applies utf-8 and cipher encoding and sets the encoding attribute to "utf-8/cipher+aes-128-cbc"](./spec/acceptance/rest/encoders_spec.rb#L78)
751
+ * with binary data
752
+ * [applies cipher encoding and sets the encoding attribute to "cipher+aes-128-cbc"](./spec/acceptance/rest/encoders_spec.rb#L89)
753
+ * with JSON data
754
+ * [applies json, utf-8 and cipher encoding and sets the encoding attribute to "json/utf-8/cipher+aes-128-cbc"](./spec/acceptance/rest/encoders_spec.rb#L100)
755
+ * with text transport protocol
756
+ * without encryption
757
+ * with UTF-8 data
758
+ * [does not apply any encoding](./spec/acceptance/rest/encoders_spec.rb#L117)
759
+ * with binary data
760
+ * [applies a base64 encoding and sets the encoding attribute to "base64"](./spec/acceptance/rest/encoders_spec.rb#L128)
761
+ * with JSON data
762
+ * [stringifies the JSON and sets the encoding attribute to "json"](./spec/acceptance/rest/encoders_spec.rb#L139)
763
+ * with encryption
764
+ * with UTF-8 data
765
+ * [applies utf-8, cipher and base64 encodings and sets the encoding attribute to "utf-8/cipher+aes-128-cbc/base64"](./spec/acceptance/rest/encoders_spec.rb#L154)
766
+ * with binary data
767
+ * [applies cipher and base64 encoding and sets the encoding attribute to "utf-8/cipher+aes-128-cbc/base64"](./spec/acceptance/rest/encoders_spec.rb#L165)
768
+ * with JSON data
769
+ * [applies json, utf-8, cipher and base64 encoding and sets the encoding attribute to "json/utf-8/cipher+aes-128-cbc/base64"](./spec/acceptance/rest/encoders_spec.rb#L176)
770
+
771
+ ### Ably::Rest::Channel messages
772
+ _(see [spec/acceptance/rest/message_spec.rb](./spec/acceptance/rest/message_spec.rb))_
773
+ * using JSON and MsgPack protocol
774
+ * publishing with an ASCII_8BIT message name
775
+ * [is converted into UTF_8](./spec/acceptance/rest/message_spec.rb#L18)
776
+ * encryption and encoding
777
+ * with #publish and #history
778
+ * with AES-128-CBC using crypto-data-128.json fixtures
779
+ * item 0 with encrypted encoding utf-8/cipher+aes-128-cbc/base64
780
+ * behaves like an Ably encrypter and decrypter
781
+ * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L65)
782
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L80)
783
+ * item 1 with encrypted encoding cipher+aes-128-cbc/base64
784
+ * behaves like an Ably encrypter and decrypter
785
+ * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L65)
786
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L80)
787
+ * item 2 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
788
+ * behaves like an Ably encrypter and decrypter
789
+ * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L65)
790
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L80)
791
+ * item 3 with encrypted encoding json/utf-8/cipher+aes-128-cbc/base64
792
+ * behaves like an Ably encrypter and decrypter
793
+ * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L65)
794
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L80)
795
+ * with AES-256-CBC using crypto-data-256.json fixtures
796
+ * item 0 with encrypted encoding utf-8/cipher+aes-256-cbc/base64
797
+ * behaves like an Ably encrypter and decrypter
798
+ * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L65)
799
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L80)
800
+ * item 1 with encrypted encoding cipher+aes-256-cbc/base64
801
+ * behaves like an Ably encrypter and decrypter
802
+ * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L65)
803
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L80)
804
+ * item 2 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
805
+ * behaves like an Ably encrypter and decrypter
806
+ * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L65)
807
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L80)
808
+ * item 3 with encrypted encoding json/utf-8/cipher+aes-256-cbc/base64
809
+ * behaves like an Ably encrypter and decrypter
810
+ * [encrypts message automatically when published](./spec/acceptance/rest/message_spec.rb#L65)
811
+ * [sends and retrieves messages that are encrypted & decrypted by the Ably library](./spec/acceptance/rest/message_spec.rb#L80)
812
+ * when publishing lots of messages
813
+ * [encrypts on #publish and decrypts on #history](./spec/acceptance/rest/message_spec.rb#L113)
814
+ * when retrieving #history with a different protocol
815
+ * [delivers a String ASCII-8BIT payload to the receiver](./spec/acceptance/rest/message_spec.rb#L140)
816
+ * [delivers a String UTF-8 payload to the receiver](./spec/acceptance/rest/message_spec.rb#L140)
817
+ * [delivers a Hash payload to the receiver](./spec/acceptance/rest/message_spec.rb#L140)
818
+ * when publishing on an unencrypted channel and retrieving with #history on an encrypted channel
819
+ * [does not attempt to decrypt the message](./spec/acceptance/rest/message_spec.rb#L156)
820
+ * when publishing on an encrypted channel and retrieving with #history on an unencrypted channel
821
+ * [retrieves the message that remains encrypted with an encrypted encoding attribute](./spec/acceptance/rest/message_spec.rb#L177)
822
+ * [logs a Cipher exception](./spec/acceptance/rest/message_spec.rb#L183)
823
+ * publishing on an encrypted channel and retrieving #history with a different algorithm on another client
824
+ * [retrieves the message that remains encrypted with an encrypted encoding attribute](./spec/acceptance/rest/message_spec.rb#L204)
825
+ * [logs a Cipher exception](./spec/acceptance/rest/message_spec.rb#L210)
826
+ * publishing on an encrypted channel and subscribing with a different key on another client
827
+ * [retrieves the message that remains encrypted with an encrypted encoding attribute](./spec/acceptance/rest/message_spec.rb#L231)
828
+ * [logs a Cipher exception](./spec/acceptance/rest/message_spec.rb#L237)
829
+
830
+ ### Ably::Rest::Presence
831
+ _(see [spec/acceptance/rest/presence_spec.rb](./spec/acceptance/rest/presence_spec.rb))_
832
+ * using JSON and MsgPack protocol
833
+ * tested against presence fixture data set up in test app
834
+ * #get
835
+ * [returns current members on the channel with their action set to :present](./spec/acceptance/rest/presence_spec.rb#L31)
836
+ * with :limit option
837
+ * [returns a paged response limiting number of members per page](./spec/acceptance/rest/presence_spec.rb#L45)
838
+ * #history
839
+ * [returns recent presence activity](./spec/acceptance/rest/presence_spec.rb#L64)
840
+ * with options
841
+ * direction: :forwards
842
+ * [returns recent presence activity forwards with most recent history last](./spec/acceptance/rest/presence_spec.rb#L80)
843
+ * direction: :backwards
844
+ * [returns recent presence activity backwards with most recent history first](./spec/acceptance/rest/presence_spec.rb#L95)
845
+ * #history
846
+ * with time range options
847
+ * :start
848
+ * with milliseconds since epoch value
849
+ * [uses this value in the history request](./spec/acceptance/rest/presence_spec.rb#L140)
850
+ * with Time object value
851
+ * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/presence_spec.rb#L150)
852
+ * :end
853
+ * with milliseconds since epoch value
854
+ * [uses this value in the history request](./spec/acceptance/rest/presence_spec.rb#L140)
855
+ * with Time object value
856
+ * [converts the value to milliseconds since epoch in the hisotry request](./spec/acceptance/rest/presence_spec.rb#L150)
857
+ * decoding
858
+ * valid decodeable content
859
+ * #get
860
+ * [automaticaly decodes presence messages](./spec/acceptance/rest/presence_spec.rb#L208)
861
+ * #history
862
+ * [automaticaly decodes presence messages](./spec/acceptance/rest/presence_spec.rb#L225)
863
+ * invalid data
864
+ * #get
865
+ * [returns the messages still encoded](./spec/acceptance/rest/presence_spec.rb#L256)
866
+ * [logs a cipher error](./spec/acceptance/rest/presence_spec.rb#L260)
867
+ * #history
868
+ * [returns the messages still encoded](./spec/acceptance/rest/presence_spec.rb#L280)
869
+ * [logs a cipher error](./spec/acceptance/rest/presence_spec.rb#L284)
870
+
871
+ ### Ably::Rest::Client#stats
872
+ _(see [spec/acceptance/rest/stats_spec.rb](./spec/acceptance/rest/stats_spec.rb))_
873
+ * using JSON and MsgPack protocol
874
+ * fetching application stats
875
+ * by minute
876
+ * with :from set to last interval and :limit set to 1
877
+ * [retrieves only one stat](./spec/acceptance/rest/stats_spec.rb#L51)
878
+ * [returns accurate all aggregated message data](./spec/acceptance/rest/stats_spec.rb#L55)
879
+ * [returns accurate inbound realtime all data](./spec/acceptance/rest/stats_spec.rb#L60)
880
+ * [returns accurate inbound realtime message data](./spec/acceptance/rest/stats_spec.rb#L65)
881
+ * [returns accurate outbound realtime all data](./spec/acceptance/rest/stats_spec.rb#L70)
882
+ * [returns accurate persisted presence all data](./spec/acceptance/rest/stats_spec.rb#L75)
883
+ * [returns accurate connections all data](./spec/acceptance/rest/stats_spec.rb#L80)
884
+ * [returns accurate channels all data](./spec/acceptance/rest/stats_spec.rb#L85)
885
+ * [returns accurate api_requests data](./spec/acceptance/rest/stats_spec.rb#L90)
886
+ * [returns accurate token_requests data](./spec/acceptance/rest/stats_spec.rb#L95)
887
+ * [returns stat objects with #interval_granularity equal to :minute](./spec/acceptance/rest/stats_spec.rb#L100)
888
+ * [returns stat objects with #interval_id matching :start](./spec/acceptance/rest/stats_spec.rb#L104)
889
+ * [returns stat objects with #interval_time matching :start Time](./spec/acceptance/rest/stats_spec.rb#L108)
890
+ * with :start set to first interval, :limit set to 1 and direction :forwards
891
+ * [returns the first interval stats as stats are provided forwards from :start](./spec/acceptance/rest/stats_spec.rb#L118)
892
+ * [returns 3 pages of stats](./spec/acceptance/rest/stats_spec.rb#L122)
893
+ * with :end set to last interval, :limit set to 1 and direction :backwards
894
+ * [returns the 3rd interval stats first as stats are provided backwards from :end](./spec/acceptance/rest/stats_spec.rb#L135)
895
+ * [returns 3 pages of stats](./spec/acceptance/rest/stats_spec.rb#L139)
896
+ * by hour
897
+ * [should aggregate the stats for that period](./spec/acceptance/rest/stats_spec.rb#L163)
898
+ * by day
899
+ * [should aggregate the stats for that period](./spec/acceptance/rest/stats_spec.rb#L163)
900
+ * by month
901
+ * [should aggregate the stats for that period](./spec/acceptance/rest/stats_spec.rb#L163)
902
+
903
+ ### Ably::Rest::Client#time
904
+ _(see [spec/acceptance/rest/time_spec.rb](./spec/acceptance/rest/time_spec.rb))_
905
+ * using JSON and MsgPack protocol
906
+ * fetching the service time
907
+ * [should return the service time as a Time object](./spec/acceptance/rest/time_spec.rb#L10)
908
+
909
+ ### Ably::Auth
910
+ _(see [spec/unit/auth_spec.rb](./spec/unit/auth_spec.rb))_
911
+ * client_id option
912
+ * with nil value
913
+ * [is permitted](./spec/unit/auth_spec.rb#L19)
914
+ * as UTF_8 string
915
+ * [is permitted](./spec/unit/auth_spec.rb#L27)
916
+ * [remains as UTF-8](./spec/unit/auth_spec.rb#L31)
917
+ * as SHIFT_JIS string
918
+ * [gets converted to UTF-8](./spec/unit/auth_spec.rb#L39)
919
+ * [is compatible with original encoding](./spec/unit/auth_spec.rb#L43)
920
+ * as ASCII_8BIT string
921
+ * [gets converted to UTF-8](./spec/unit/auth_spec.rb#L51)
922
+ * [is compatible with original encoding](./spec/unit/auth_spec.rb#L55)
923
+ * as Integer
924
+ * [raises an argument error](./spec/unit/auth_spec.rb#L63)
925
+
926
+ ### Ably::Logger
927
+ _(see [spec/unit/logger_spec.rb](./spec/unit/logger_spec.rb))_
928
+ * [uses the language provided Logger by default](./spec/unit/logger_spec.rb#L15)
929
+ * with a custom Logger
930
+ * with an invalid interface
931
+ * [raises an exception](./spec/unit/logger_spec.rb#L116)
932
+ * with a valid interface
933
+ * [is used](./spec/unit/logger_spec.rb#L135)
934
+
935
+ ### Ably::Models::ErrorInfo
936
+ _(see [spec/unit/models/error_info_spec.rb](./spec/unit/models/error_info_spec.rb))_
937
+ * behaves like a model
938
+ * attributes
939
+ * #code
940
+ * [retrieves attribute :code](./spec/shared/model_behaviour.rb#L15)
941
+ * #status_code
942
+ * [retrieves attribute :status_code](./spec/shared/model_behaviour.rb#L15)
943
+ * #message
944
+ * [retrieves attribute :message](./spec/shared/model_behaviour.rb#L15)
945
+ * #==
946
+ * [is true when attributes are the same](./spec/shared/model_behaviour.rb#L41)
947
+ * [is false when attributes are not the same](./spec/shared/model_behaviour.rb#L46)
948
+ * [is false when class type differs](./spec/shared/model_behaviour.rb#L50)
949
+ * is immutable
950
+ * [prevents changes](./spec/shared/model_behaviour.rb#L76)
951
+ * [dups options](./spec/shared/model_behaviour.rb#L80)
952
+ * #status
953
+ * [is an alias for #status_code](./spec/unit/models/error_info_spec.rb#L13)
954
+
955
+ ### Ably::Models::MessageEncoders::Base64
956
+ _(see [spec/unit/models/message_encoders/base64_spec.rb](./spec/unit/models/message_encoders/base64_spec.rb))_
957
+ * #decode
958
+ * message with base64 payload
959
+ * [decodes base64](./spec/unit/models/message_encoders/base64_spec.rb#L24)
960
+ * [strips the encoding](./spec/unit/models/message_encoders/base64_spec.rb#L28)
961
+ * message with base64 payload before other payloads
962
+ * [decodes base64](./spec/unit/models/message_encoders/base64_spec.rb#L36)
963
+ * [strips the encoding](./spec/unit/models/message_encoders/base64_spec.rb#L40)
964
+ * message with another payload
965
+ * [leaves the message data intact](./spec/unit/models/message_encoders/base64_spec.rb#L48)
966
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L52)
967
+ * #encode
968
+ * over binary transport
969
+ * message with binary payload
970
+ * [leaves the message data intact as Base64 encoding is not necessary](./spec/unit/models/message_encoders/base64_spec.rb#L68)
971
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L72)
972
+ * already encoded message with binary payload
973
+ * [leaves the message data intact as Base64 encoding is not necessary](./spec/unit/models/message_encoders/base64_spec.rb#L80)
974
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L84)
975
+ * message with UTF-8 payload
976
+ * [leaves the data intact](./spec/unit/models/message_encoders/base64_spec.rb#L92)
977
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L96)
978
+ * message with nil payload
979
+ * [leaves the message data intact](./spec/unit/models/message_encoders/base64_spec.rb#L104)
980
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L108)
981
+ * message with empty binary string payload
982
+ * [leaves the message data intact](./spec/unit/models/message_encoders/base64_spec.rb#L116)
983
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L120)
984
+ * over text transport
985
+ * message with binary payload
986
+ * [encodes binary data as base64](./spec/unit/models/message_encoders/base64_spec.rb#L135)
987
+ * [adds the encoding](./spec/unit/models/message_encoders/base64_spec.rb#L139)
988
+ * already encoded message with binary payload
989
+ * [encodes binary data as base64](./spec/unit/models/message_encoders/base64_spec.rb#L147)
990
+ * [adds the encoding](./spec/unit/models/message_encoders/base64_spec.rb#L151)
991
+ * message with UTF-8 payload
992
+ * [leaves the data intact](./spec/unit/models/message_encoders/base64_spec.rb#L159)
993
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L163)
994
+ * message with nil payload
995
+ * [leaves the message data intact](./spec/unit/models/message_encoders/base64_spec.rb#L171)
996
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/base64_spec.rb#L175)
997
+
998
+ ### Ably::Models::MessageEncoders::Cipher
999
+ _(see [spec/unit/models/message_encoders/cipher_spec.rb](./spec/unit/models/message_encoders/cipher_spec.rb))_
1000
+ * #decode
1001
+ * with channel set up for AES-128-CBC
1002
+ * valid cipher data
1003
+ * message with cipher payload
1004
+ * [decodes cipher](./spec/unit/models/message_encoders/cipher_spec.rb#L32)
1005
+ * [strips the encoding](./spec/unit/models/message_encoders/cipher_spec.rb#L36)
1006
+ * message with cipher payload before other payloads
1007
+ * [decodes cipher](./spec/unit/models/message_encoders/cipher_spec.rb#L44)
1008
+ * [strips the encoding](./spec/unit/models/message_encoders/cipher_spec.rb#L48)
1009
+ * message with binary payload
1010
+ * [decodes cipher](./spec/unit/models/message_encoders/cipher_spec.rb#L56)
1011
+ * [strips the encoding](./spec/unit/models/message_encoders/cipher_spec.rb#L60)
1012
+ * [returns ASCII_8BIT encoded binary data](./spec/unit/models/message_encoders/cipher_spec.rb#L64)
1013
+ * message with another payload
1014
+ * [leaves the message data intact](./spec/unit/models/message_encoders/cipher_spec.rb#L72)
1015
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/cipher_spec.rb#L76)
1016
+ * with invalid channel_option cipher params
1017
+ * [raise an exception](./spec/unit/models/message_encoders/cipher_spec.rb#L87)
1018
+ * without any configured encryption
1019
+ * [raise an exception](./spec/unit/models/message_encoders/cipher_spec.rb#L97)
1020
+ * with invalid cipher data
1021
+ * [raise an exception](./spec/unit/models/message_encoders/cipher_spec.rb#L106)
1022
+ * with AES-256-CBC
1023
+ * message with cipher payload
1024
+ * [decodes cipher](./spec/unit/models/message_encoders/cipher_spec.rb#L122)
1025
+ * [strips the encoding](./spec/unit/models/message_encoders/cipher_spec.rb#L126)
1026
+ * #encode
1027
+ * with channel set up for AES-128-CBC
1028
+ * with encrypted set to true
1029
+ * message with string payload
1030
+ * [encodes cipher](./spec/unit/models/message_encoders/cipher_spec.rb#L146)
1031
+ * [adds the encoding with utf-8](./spec/unit/models/message_encoders/cipher_spec.rb#L151)
1032
+ * message with binary payload
1033
+ * [encodes cipher](./spec/unit/models/message_encoders/cipher_spec.rb#L159)
1034
+ * [adds the encoding without utf-8 prefixed](./spec/unit/models/message_encoders/cipher_spec.rb#L164)
1035
+ * [returns ASCII_8BIT encoded binary data](./spec/unit/models/message_encoders/cipher_spec.rb#L168)
1036
+ * message with json payload
1037
+ * [encodes cipher](./spec/unit/models/message_encoders/cipher_spec.rb#L176)
1038
+ * [adds the encoding with utf-8](./spec/unit/models/message_encoders/cipher_spec.rb#L181)
1039
+ * message with existing cipher encoding before
1040
+ * [leaves message intact as it is already encrypted](./spec/unit/models/message_encoders/cipher_spec.rb#L189)
1041
+ * [leaves encoding intact](./spec/unit/models/message_encoders/cipher_spec.rb#L193)
1042
+ * with encryption set to to false
1043
+ * [leaves message intact as encryption is not enable](./spec/unit/models/message_encoders/cipher_spec.rb#L202)
1044
+ * [leaves encoding intact](./spec/unit/models/message_encoders/cipher_spec.rb#L206)
1045
+ * channel_option cipher params
1046
+ * have invalid key length
1047
+ * [raise an exception](./spec/unit/models/message_encoders/cipher_spec.rb#L218)
1048
+ * have invalid algorithm
1049
+ * [raise an exception](./spec/unit/models/message_encoders/cipher_spec.rb#L225)
1050
+ * have missing key
1051
+ * [raise an exception](./spec/unit/models/message_encoders/cipher_spec.rb#L232)
1052
+ * with AES-256-CBC
1053
+ * message with cipher payload
1054
+ * [decodes cipher](./spec/unit/models/message_encoders/cipher_spec.rb#L249)
1055
+ * [strips the encoding](./spec/unit/models/message_encoders/cipher_spec.rb#L254)
1056
+
1057
+ ### Ably::Models::MessageEncoders::Json
1058
+ _(see [spec/unit/models/message_encoders/json_spec.rb](./spec/unit/models/message_encoders/json_spec.rb))_
1059
+ * #decode
1060
+ * message with json payload
1061
+ * [decodes json](./spec/unit/models/message_encoders/json_spec.rb#L24)
1062
+ * [strips the encoding](./spec/unit/models/message_encoders/json_spec.rb#L28)
1063
+ * message with json payload before other payloads
1064
+ * [decodes json](./spec/unit/models/message_encoders/json_spec.rb#L36)
1065
+ * [strips the encoding](./spec/unit/models/message_encoders/json_spec.rb#L40)
1066
+ * message with another payload
1067
+ * [leaves the message data intact](./spec/unit/models/message_encoders/json_spec.rb#L48)
1068
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/json_spec.rb#L52)
1069
+ * #encode
1070
+ * message with hash payload
1071
+ * [encodes hash payload data as json](./spec/unit/models/message_encoders/json_spec.rb#L66)
1072
+ * [adds the encoding](./spec/unit/models/message_encoders/json_spec.rb#L70)
1073
+ * already encoded message with hash payload
1074
+ * [encodes hash payload data as json](./spec/unit/models/message_encoders/json_spec.rb#L78)
1075
+ * [adds the encoding](./spec/unit/models/message_encoders/json_spec.rb#L82)
1076
+ * message with Array payload
1077
+ * [encodes Array payload data as json](./spec/unit/models/message_encoders/json_spec.rb#L90)
1078
+ * [adds the encoding](./spec/unit/models/message_encoders/json_spec.rb#L94)
1079
+ * message with UTF-8 payload
1080
+ * [leaves the message data intact](./spec/unit/models/message_encoders/json_spec.rb#L102)
1081
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/json_spec.rb#L106)
1082
+ * message with nil payload
1083
+ * [leaves the message data intact](./spec/unit/models/message_encoders/json_spec.rb#L114)
1084
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/json_spec.rb#L118)
1085
+ * message with no data payload
1086
+ * [leaves the message data intact](./spec/unit/models/message_encoders/json_spec.rb#L126)
1087
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/json_spec.rb#L130)
1088
+
1089
+ ### Ably::Models::MessageEncoders::Utf8
1090
+ _(see [spec/unit/models/message_encoders/utf8_spec.rb](./spec/unit/models/message_encoders/utf8_spec.rb))_
1091
+ * #decode
1092
+ * message with utf8 payload
1093
+ * [sets the encoding](./spec/unit/models/message_encoders/utf8_spec.rb#L21)
1094
+ * [strips the encoding](./spec/unit/models/message_encoders/utf8_spec.rb#L26)
1095
+ * message with utf8 payload before other payloads
1096
+ * [sets the encoding](./spec/unit/models/message_encoders/utf8_spec.rb#L34)
1097
+ * [strips the encoding](./spec/unit/models/message_encoders/utf8_spec.rb#L39)
1098
+ * message with another payload
1099
+ * [leaves the message data intact](./spec/unit/models/message_encoders/utf8_spec.rb#L47)
1100
+ * [leaves the encoding intact](./spec/unit/models/message_encoders/utf8_spec.rb#L51)
1101
+
1102
+ ### Ably::Models::Message
1103
+ _(see [spec/unit/models/message_spec.rb](./spec/unit/models/message_spec.rb))_
1104
+ * behaves like a model
1105
+ * attributes
1106
+ * #name
1107
+ * [retrieves attribute :name](./spec/shared/model_behaviour.rb#L15)
1108
+ * #client_id
1109
+ * [retrieves attribute :client_id](./spec/shared/model_behaviour.rb#L15)
1110
+ * #data
1111
+ * [retrieves attribute :data](./spec/shared/model_behaviour.rb#L15)
1112
+ * #encoding
1113
+ * [retrieves attribute :encoding](./spec/shared/model_behaviour.rb#L15)
1114
+ * #==
1115
+ * [is true when attributes are the same](./spec/shared/model_behaviour.rb#L41)
1116
+ * [is false when attributes are not the same](./spec/shared/model_behaviour.rb#L46)
1117
+ * [is false when class type differs](./spec/shared/model_behaviour.rb#L50)
1118
+ * is immutable
1119
+ * [prevents changes](./spec/shared/model_behaviour.rb#L76)
1120
+ * [dups options](./spec/shared/model_behaviour.rb#L80)
1121
+ * #timestamp
1122
+ * [retrieves attribute :timestamp as Time object from ProtocolMessage](./spec/unit/models/message_spec.rb#L21)
1123
+ * #connection_id attribute
1124
+ * when this model has a connectionId attribute
1125
+ * but no protocol message
1126
+ * [uses the model value](./spec/unit/models/message_spec.rb#L36)
1127
+ * with a protocol message with a different connectionId
1128
+ * [uses the model value](./spec/unit/models/message_spec.rb#L44)
1129
+ * when this model has no connectionId attribute
1130
+ * and no protocol message
1131
+ * [uses the model value](./spec/unit/models/message_spec.rb#L54)
1132
+ * with a protocol message with a connectionId
1133
+ * [uses the model value](./spec/unit/models/message_spec.rb#L62)
1134
+ * initialized with
1135
+ * :name
1136
+ * as UTF_8 string
1137
+ * [is permitted](./spec/unit/models/message_spec.rb#L89)
1138
+ * [remains as UTF-8](./spec/unit/models/message_spec.rb#L93)
1139
+ * as SHIFT_JIS string
1140
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L101)
1141
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L105)
1142
+ * as ASCII_8BIT string
1143
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L113)
1144
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L117)
1145
+ * as Integer
1146
+ * [raises an argument error](./spec/unit/models/message_spec.rb#L125)
1147
+ * as Nil
1148
+ * [is permitted](./spec/unit/models/message_spec.rb#L133)
1149
+ * :client_id
1150
+ * as UTF_8 string
1151
+ * [is permitted](./spec/unit/models/message_spec.rb#L89)
1152
+ * [remains as UTF-8](./spec/unit/models/message_spec.rb#L93)
1153
+ * as SHIFT_JIS string
1154
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L101)
1155
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L105)
1156
+ * as ASCII_8BIT string
1157
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L113)
1158
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L117)
1159
+ * as Integer
1160
+ * [raises an argument error](./spec/unit/models/message_spec.rb#L125)
1161
+ * as Nil
1162
+ * [is permitted](./spec/unit/models/message_spec.rb#L133)
1163
+ * :encoding
1164
+ * as UTF_8 string
1165
+ * [is permitted](./spec/unit/models/message_spec.rb#L89)
1166
+ * [remains as UTF-8](./spec/unit/models/message_spec.rb#L93)
1167
+ * as SHIFT_JIS string
1168
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L101)
1169
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L105)
1170
+ * as ASCII_8BIT string
1171
+ * [gets converted to UTF-8](./spec/unit/models/message_spec.rb#L113)
1172
+ * [is compatible with original encoding](./spec/unit/models/message_spec.rb#L117)
1173
+ * as Integer
1174
+ * [raises an argument error](./spec/unit/models/message_spec.rb#L125)
1175
+ * as Nil
1176
+ * [is permitted](./spec/unit/models/message_spec.rb#L133)
1177
+
1178
+ ### Ably::Models::PaginatedResource
1179
+ _(see [spec/unit/models/paginated_resource_spec.rb](./spec/unit/models/paginated_resource_spec.rb))_
1180
+ * [returns correct length from body](./spec/unit/models/paginated_resource_spec.rb#L30)
1181
+ * [supports alias methods for length](./spec/unit/models/paginated_resource_spec.rb#L34)
1182
+ * [is Enumerable](./spec/unit/models/paginated_resource_spec.rb#L39)
1183
+ * [is iterable](./spec/unit/models/paginated_resource_spec.rb#L43)
1184
+ * [provides [] accessor method](./spec/unit/models/paginated_resource_spec.rb#L61)
1185
+ * [#first gets the first item in page](./spec/unit/models/paginated_resource_spec.rb#L67)
1186
+ * [#last gets the last item in page](./spec/unit/models/paginated_resource_spec.rb#L71)
1187
+ * #each
1188
+ * [returns an enumerator](./spec/unit/models/paginated_resource_spec.rb#L48)
1189
+ * [yields each item](./spec/unit/models/paginated_resource_spec.rb#L52)
1190
+ * with non paged http response
1191
+ * [is the first page](./spec/unit/models/paginated_resource_spec.rb#L175)
1192
+ * [is the last page](./spec/unit/models/paginated_resource_spec.rb#L179)
1193
+ * [does not support pagination](./spec/unit/models/paginated_resource_spec.rb#L183)
1194
+ * [raises an exception when accessing next page](./spec/unit/models/paginated_resource_spec.rb#L187)
1195
+ * [raises an exception when accessing first page](./spec/unit/models/paginated_resource_spec.rb#L191)
1196
+ * with paged http response
1197
+ * [is the first page](./spec/unit/models/paginated_resource_spec.rb#L209)
1198
+ * [is not the last page](./spec/unit/models/paginated_resource_spec.rb#L213)
1199
+ * [supports pagination](./spec/unit/models/paginated_resource_spec.rb#L217)
1200
+ * accessing next page
1201
+ * [returns another PaginatedResource](./spec/unit/models/paginated_resource_spec.rb#L245)
1202
+ * [retrieves the next page of results](./spec/unit/models/paginated_resource_spec.rb#L249)
1203
+ * [is not the first page](./spec/unit/models/paginated_resource_spec.rb#L254)
1204
+ * [is the last page](./spec/unit/models/paginated_resource_spec.rb#L258)
1205
+ * [raises an exception if trying to access the last page when it is the last page](./spec/unit/models/paginated_resource_spec.rb#L262)
1206
+ * and then first page
1207
+ * [returns a PaginatedResource](./spec/unit/models/paginated_resource_spec.rb#L273)
1208
+ * [retrieves the first page of results](./spec/unit/models/paginated_resource_spec.rb#L277)
1209
+ * [is the first page](./spec/unit/models/paginated_resource_spec.rb#L281)
1210
+
1211
+ ### Ably::Models::PresenceMessage
1212
+ _(see [spec/unit/models/presence_message_spec.rb](./spec/unit/models/presence_message_spec.rb))_
1213
+ * behaves like a model
1214
+ * attributes
1215
+ * #client_id
1216
+ * [retrieves attribute :client_id](./spec/shared/model_behaviour.rb#L15)
1217
+ * #data
1218
+ * [retrieves attribute :data](./spec/shared/model_behaviour.rb#L15)
1219
+ * #encoding
1220
+ * [retrieves attribute :encoding](./spec/shared/model_behaviour.rb#L15)
1221
+ * #==
1222
+ * [is true when attributes are the same](./spec/shared/model_behaviour.rb#L41)
1223
+ * [is false when attributes are not the same](./spec/shared/model_behaviour.rb#L46)
1224
+ * [is false when class type differs](./spec/shared/model_behaviour.rb#L50)
1225
+ * is immutable
1226
+ * [prevents changes](./spec/shared/model_behaviour.rb#L76)
1227
+ * [dups options](./spec/shared/model_behaviour.rb#L80)
1228
+ * #connection_id attribute
1229
+ * when this model has a connectionId attribute
1230
+ * but no protocol message
1231
+ * [uses the model value](./spec/unit/models/presence_message_spec.rb#L25)
1232
+ * with a protocol message with a different connectionId
1233
+ * [uses the model value](./spec/unit/models/presence_message_spec.rb#L33)
1234
+ * when this model has no connectionId attribute
1235
+ * and no protocol message
1236
+ * [uses the model value](./spec/unit/models/presence_message_spec.rb#L43)
1237
+ * with a protocol message with a connectionId
1238
+ * [uses the model value](./spec/unit/models/presence_message_spec.rb#L51)
1239
+ * #member_key attribute
1240
+ * [is string in format connection_id:client_id](./spec/unit/models/presence_message_spec.rb#L61)
1241
+ * with the same client id across multiple connections
1242
+ * [is unique](./spec/unit/models/presence_message_spec.rb#L69)
1243
+ * with a single connection and different client_ids
1244
+ * [is unique](./spec/unit/models/presence_message_spec.rb#L78)
1245
+ * #timestamp
1246
+ * [retrieves attribute :timestamp as a Time object from ProtocolMessage](./spec/unit/models/presence_message_spec.rb#L86)
1247
+ * initialized with
1248
+ * :client_id
1249
+ * as UTF_8 string
1250
+ * [is permitted](./spec/unit/models/presence_message_spec.rb#L138)
1251
+ * [remains as UTF-8](./spec/unit/models/presence_message_spec.rb#L142)
1252
+ * as SHIFT_JIS string
1253
+ * [gets converted to UTF-8](./spec/unit/models/presence_message_spec.rb#L150)
1254
+ * [is compatible with original encoding](./spec/unit/models/presence_message_spec.rb#L154)
1255
+ * as ASCII_8BIT string
1256
+ * [gets converted to UTF-8](./spec/unit/models/presence_message_spec.rb#L162)
1257
+ * [is compatible with original encoding](./spec/unit/models/presence_message_spec.rb#L166)
1258
+ * as Integer
1259
+ * [raises an argument error](./spec/unit/models/presence_message_spec.rb#L174)
1260
+ * as Nil
1261
+ * [is permitted](./spec/unit/models/presence_message_spec.rb#L182)
1262
+ * :connection_id
1263
+ * as UTF_8 string
1264
+ * [is permitted](./spec/unit/models/presence_message_spec.rb#L138)
1265
+ * [remains as UTF-8](./spec/unit/models/presence_message_spec.rb#L142)
1266
+ * as SHIFT_JIS string
1267
+ * [gets converted to UTF-8](./spec/unit/models/presence_message_spec.rb#L150)
1268
+ * [is compatible with original encoding](./spec/unit/models/presence_message_spec.rb#L154)
1269
+ * as ASCII_8BIT string
1270
+ * [gets converted to UTF-8](./spec/unit/models/presence_message_spec.rb#L162)
1271
+ * [is compatible with original encoding](./spec/unit/models/presence_message_spec.rb#L166)
1272
+ * as Integer
1273
+ * [raises an argument error](./spec/unit/models/presence_message_spec.rb#L174)
1274
+ * as Nil
1275
+ * [is permitted](./spec/unit/models/presence_message_spec.rb#L182)
1276
+ * :encoding
1277
+ * as UTF_8 string
1278
+ * [is permitted](./spec/unit/models/presence_message_spec.rb#L138)
1279
+ * [remains as UTF-8](./spec/unit/models/presence_message_spec.rb#L142)
1280
+ * as SHIFT_JIS string
1281
+ * [gets converted to UTF-8](./spec/unit/models/presence_message_spec.rb#L150)
1282
+ * [is compatible with original encoding](./spec/unit/models/presence_message_spec.rb#L154)
1283
+ * as ASCII_8BIT string
1284
+ * [gets converted to UTF-8](./spec/unit/models/presence_message_spec.rb#L162)
1285
+ * [is compatible with original encoding](./spec/unit/models/presence_message_spec.rb#L166)
1286
+ * as Integer
1287
+ * [raises an argument error](./spec/unit/models/presence_message_spec.rb#L174)
1288
+ * as Nil
1289
+ * [is permitted](./spec/unit/models/presence_message_spec.rb#L182)
1290
+
1291
+ ### Ably::Models::ProtocolMessage
1292
+ _(see [spec/unit/models/protocol_message_spec.rb](./spec/unit/models/protocol_message_spec.rb))_
1293
+ * behaves like a model
1294
+ * attributes
1295
+ * #id
1296
+ * [retrieves attribute :id](./spec/shared/model_behaviour.rb#L15)
1297
+ * #channel
1298
+ * [retrieves attribute :channel](./spec/shared/model_behaviour.rb#L15)
1299
+ * #channel_serial
1300
+ * [retrieves attribute :channel_serial](./spec/shared/model_behaviour.rb#L15)
1301
+ * #connection_id
1302
+ * [retrieves attribute :connection_id](./spec/shared/model_behaviour.rb#L15)
1303
+ * #==
1304
+ * [is true when attributes are the same](./spec/shared/model_behaviour.rb#L41)
1305
+ * [is false when attributes are not the same](./spec/shared/model_behaviour.rb#L46)
1306
+ * [is false when class type differs](./spec/shared/model_behaviour.rb#L50)
1307
+ * is immutable
1308
+ * [prevents changes](./spec/shared/model_behaviour.rb#L76)
1309
+ * [dups options](./spec/shared/model_behaviour.rb#L80)
1310
+ * attributes
1311
+ * #timestamp
1312
+ * [retrieves attribute :timestamp as Time object](./spec/unit/models/protocol_message_spec.rb#L74)
1313
+ * #count
1314
+ * when missing
1315
+ * [is 1](./spec/unit/models/protocol_message_spec.rb#L83)
1316
+ * when non numeric
1317
+ * [is 1](./spec/unit/models/protocol_message_spec.rb#L90)
1318
+ * when greater than 1
1319
+ * [is the value of count](./spec/unit/models/protocol_message_spec.rb#L97)
1320
+ * #message_serial
1321
+ * [converts :msg_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L105)
1322
+ * #has_message_serial?
1323
+ * without msg_serial
1324
+ * [returns false](./spec/unit/models/protocol_message_spec.rb#L115)
1325
+ * with msg_serial
1326
+ * [returns true](./spec/unit/models/protocol_message_spec.rb#L123)
1327
+ * #connection_serial
1328
+ * [converts :connection_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L131)
1329
+ * #flags
1330
+ * when nil
1331
+ * [is zero](./spec/unit/models/protocol_message_spec.rb#L141)
1332
+ * when numeric
1333
+ * [is an Integer](./spec/unit/models/protocol_message_spec.rb#L149)
1334
+ * when has_presence
1335
+ * [#has_presence_flag? is true](./spec/unit/models/protocol_message_spec.rb#L157)
1336
+ * when has another future flag
1337
+ * [#has_presence_flag? is false](./spec/unit/models/protocol_message_spec.rb#L165)
1338
+ * #has_connection_serial?
1339
+ * without connection_serial
1340
+ * [returns false](./spec/unit/models/protocol_message_spec.rb#L175)
1341
+ * with connection_serial
1342
+ * [returns true](./spec/unit/models/protocol_message_spec.rb#L183)
1343
+ * #serial
1344
+ * with underlying msg_serial
1345
+ * [converts :msg_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L192)
1346
+ * with underlying connection_serial
1347
+ * [converts :connection_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L200)
1348
+ * with underlying connection_serial and msg_serial
1349
+ * [prefers connection_serial and converts :connection_serial to an Integer](./spec/unit/models/protocol_message_spec.rb#L208)
1350
+ * #has_serial?
1351
+ * without msg_serial or connection_serial
1352
+ * [returns false](./spec/unit/models/protocol_message_spec.rb#L219)
1353
+ * with msg_serial
1354
+ * [returns true](./spec/unit/models/protocol_message_spec.rb#L227)
1355
+ * with connection_serial
1356
+ * [returns true](./spec/unit/models/protocol_message_spec.rb#L235)
1357
+ * #error
1358
+ * with no error attribute
1359
+ * [returns nil](./spec/unit/models/protocol_message_spec.rb#L245)
1360
+ * with nil error
1361
+ * [returns nil](./spec/unit/models/protocol_message_spec.rb#L253)
1362
+ * with error
1363
+ * [returns a valid ErrorInfo object](./spec/unit/models/protocol_message_spec.rb#L261)
1364
+
1365
+ ### Ably::Models::Stat
1366
+ _(see [spec/unit/models/stat_spec.rb](./spec/unit/models/stat_spec.rb))_
1367
+ * behaves like a model
1368
+ * attributes
1369
+ * #interval_id
1370
+ * [retrieves attribute :interval_id](./spec/shared/model_behaviour.rb#L15)
1371
+ * #all
1372
+ * [retrieves attribute :all](./spec/shared/model_behaviour.rb#L15)
1373
+ * #inbound
1374
+ * [retrieves attribute :inbound](./spec/shared/model_behaviour.rb#L15)
1375
+ * #outbound
1376
+ * [retrieves attribute :outbound](./spec/shared/model_behaviour.rb#L15)
1377
+ * #persisted
1378
+ * [retrieves attribute :persisted](./spec/shared/model_behaviour.rb#L15)
1379
+ * #connections
1380
+ * [retrieves attribute :connections](./spec/shared/model_behaviour.rb#L15)
1381
+ * #channels
1382
+ * [retrieves attribute :channels](./spec/shared/model_behaviour.rb#L15)
1383
+ * #api_requests
1384
+ * [retrieves attribute :api_requests](./spec/shared/model_behaviour.rb#L15)
1385
+ * #token_requests
1386
+ * [retrieves attribute :token_requests](./spec/shared/model_behaviour.rb#L15)
1387
+ * #==
1388
+ * [is true when attributes are the same](./spec/shared/model_behaviour.rb#L41)
1389
+ * [is false when attributes are not the same](./spec/shared/model_behaviour.rb#L46)
1390
+ * [is false when class type differs](./spec/shared/model_behaviour.rb#L50)
1391
+ * is immutable
1392
+ * [prevents changes](./spec/shared/model_behaviour.rb#L76)
1393
+ * [dups options](./spec/shared/model_behaviour.rb#L80)
1394
+ * #interval_granularity
1395
+ * [returns the granularity of the interval_id](./spec/unit/models/stat_spec.rb#L17)
1396
+ * #interval_time
1397
+ * [returns a Time object representing the start of the interval](./spec/unit/models/stat_spec.rb#L25)
1398
+ * class methods
1399
+ * #to_interval_id
1400
+ * when time zone of time argument is UTC
1401
+ * [converts time 2014-02-03:05:06 with granularity :month into 2014-02](./spec/unit/models/stat_spec.rb#L33)
1402
+ * [converts time 2014-02-03:05:06 with granularity :day into 2014-02-03](./spec/unit/models/stat_spec.rb#L37)
1403
+ * [converts time 2014-02-03:05:06 with granularity :hour into 2014-02-03:05](./spec/unit/models/stat_spec.rb#L41)
1404
+ * [converts time 2014-02-03:05:06 with granularity :minute into 2014-02-03:05:06](./spec/unit/models/stat_spec.rb#L45)
1405
+ * [fails with invalid granularity](./spec/unit/models/stat_spec.rb#L49)
1406
+ * [fails with invalid time](./spec/unit/models/stat_spec.rb#L53)
1407
+ * when time zone of time argument is +02:00
1408
+ * [converts time 2014-02-03:06 with granularity :hour into 2014-02-03:04 at UTC +00:00](./spec/unit/models/stat_spec.rb#L59)
1409
+ * #from_interval_id
1410
+ * [converts a month interval_id 2014-02 into a Time object in UTC 0](./spec/unit/models/stat_spec.rb#L66)
1411
+ * [converts a day interval_id 2014-02-03 into a Time object in UTC 0](./spec/unit/models/stat_spec.rb#L71)
1412
+ * [converts an hour interval_id 2014-02-03:05 into a Time object in UTC 0](./spec/unit/models/stat_spec.rb#L76)
1413
+ * [converts a minute interval_id 2014-02-03:05:06 into a Time object in UTC 0](./spec/unit/models/stat_spec.rb#L81)
1414
+ * [fails with an invalid interval_id 14-20](./spec/unit/models/stat_spec.rb#L86)
1415
+ * #granularity_from_interval_id
1416
+ * [returns a :month interval_id for 2014-02](./spec/unit/models/stat_spec.rb#L92)
1417
+ * [returns a :day interval_id for 2014-02-03](./spec/unit/models/stat_spec.rb#L96)
1418
+ * [returns a :hour interval_id for 2014-02-03:05](./spec/unit/models/stat_spec.rb#L100)
1419
+ * [returns a :minute interval_id for 2014-02-03:05:06](./spec/unit/models/stat_spec.rb#L104)
1420
+ * [fails with an invalid interval_id 14-20](./spec/unit/models/stat_spec.rb#L108)
1421
+
1422
+ ### Ably::Models::Token
1423
+ _(see [spec/unit/models/token_spec.rb](./spec/unit/models/token_spec.rb))_
1424
+ * behaves like a model
1425
+ * attributes
1426
+ * #id
1427
+ * [retrieves attribute :id](./spec/shared/model_behaviour.rb#L15)
1428
+ * #capability
1429
+ * [retrieves attribute :capability](./spec/shared/model_behaviour.rb#L15)
1430
+ * #client_id
1431
+ * [retrieves attribute :client_id](./spec/shared/model_behaviour.rb#L15)
1432
+ * #nonce
1433
+ * [retrieves attribute :nonce](./spec/shared/model_behaviour.rb#L15)
1434
+ * #==
1435
+ * [is true when attributes are the same](./spec/shared/model_behaviour.rb#L41)
1436
+ * [is false when attributes are not the same](./spec/shared/model_behaviour.rb#L46)
1437
+ * [is false when class type differs](./spec/shared/model_behaviour.rb#L50)
1438
+ * is immutable
1439
+ * [prevents changes](./spec/shared/model_behaviour.rb#L76)
1440
+ * [dups options](./spec/shared/model_behaviour.rb#L80)
1441
+ * defaults
1442
+ * [should default TTL to 1 hour](./spec/unit/models/token_spec.rb#L14)
1443
+ * [should default capability to all](./spec/unit/models/token_spec.rb#L18)
1444
+ * [should only have defaults for :ttl and :capability](./spec/unit/models/token_spec.rb#L22)
1445
+ * attributes
1446
+ * #key_id
1447
+ * [retrieves attribute :key](./spec/unit/models/token_spec.rb#L32)
1448
+ * #issued_at
1449
+ * [retrieves attribute :issued_at as Time](./spec/unit/models/token_spec.rb#L42)
1450
+ * #expires_at
1451
+ * [retrieves attribute :expires as Time](./spec/unit/models/token_spec.rb#L42)
1452
+ * #expired?
1453
+ * once grace period buffer has passed
1454
+ * [is true](./spec/unit/models/token_spec.rb#L55)
1455
+ * within grace period buffer
1456
+ * [is false](./spec/unit/models/token_spec.rb#L63)
1457
+ * ==
1458
+ * [is true when attributes are the same](./spec/unit/models/token_spec.rb#L73)
1459
+ * [is false when attributes are not the same](./spec/unit/models/token_spec.rb#L78)
1460
+ * [is false when class type differs](./spec/unit/models/token_spec.rb#L82)
1461
+
1462
+ ### Ably::Modules::EventEmitter
1463
+ _(see [spec/unit/modules/event_emitter_spec.rb](./spec/unit/modules/event_emitter_spec.rb))_
1464
+ * #trigger event fan out
1465
+ * [should emit an event for any number of subscribers](./spec/unit/modules/event_emitter_spec.rb#L18)
1466
+ * [sends only messages to matching event names](./spec/unit/modules/event_emitter_spec.rb#L27)
1467
+ * #on subscribe to multiple events
1468
+ * [with the same block](./spec/unit/modules/event_emitter_spec.rb#L59)
1469
+ * event callback changes within the callback block
1470
+ * when new event callbacks are added
1471
+ * [is unaffected and processes the prior event callbacks once](./spec/unit/modules/event_emitter_spec.rb#L83)
1472
+ * [adds them for the next emitted event](./spec/unit/modules/event_emitter_spec.rb#L89)
1473
+ * when callbacks are removed
1474
+ * [is unaffected and processes the prior event callbacks once](./spec/unit/modules/event_emitter_spec.rb#L110)
1475
+ * [removes them for the next emitted event](./spec/unit/modules/event_emitter_spec.rb#L115)
1476
+ * #once
1477
+ * [calls the block the first time an event is emitted only](./spec/unit/modules/event_emitter_spec.rb#L128)
1478
+ * [does not remove other blocks after it is called](./spec/unit/modules/event_emitter_spec.rb#L135)
1479
+ * #off
1480
+ * with event names as arguments
1481
+ * [deletes matching callbacks](./spec/unit/modules/event_emitter_spec.rb#L156)
1482
+ * [deletes all callbacks if not block given](./spec/unit/modules/event_emitter_spec.rb#L161)
1483
+ * [continues if the block does not exist](./spec/unit/modules/event_emitter_spec.rb#L166)
1484
+ * without any event names
1485
+ * [deletes all matching callbacks](./spec/unit/modules/event_emitter_spec.rb#L173)
1486
+ * [deletes all callbacks if not block given](./spec/unit/modules/event_emitter_spec.rb#L178)
1487
+
1488
+ ### Ably::Modules::StateEmitter
1489
+ _(see [spec/unit/modules/state_emitter_spec.rb](./spec/unit/modules/state_emitter_spec.rb))_
1490
+ * [#state returns current state](./spec/unit/modules/state_emitter_spec.rb#L25)
1491
+ * [#state= sets current state](./spec/unit/modules/state_emitter_spec.rb#L29)
1492
+ * [#change_state sets current state](./spec/unit/modules/state_emitter_spec.rb#L33)
1493
+ * #change_state with arguments
1494
+ * [passes the arguments through to the triggered callback](./spec/unit/modules/state_emitter_spec.rb#L41)
1495
+ * #state?
1496
+ * [returns true if state matches](./spec/unit/modules/state_emitter_spec.rb#L52)
1497
+ * [returns false if state does not match](./spec/unit/modules/state_emitter_spec.rb#L56)
1498
+ * and convenience predicates for states
1499
+ * [returns true for #initializing? if state matches](./spec/unit/modules/state_emitter_spec.rb#L61)
1500
+ * [returns false for #connecting? if state does not match](./spec/unit/modules/state_emitter_spec.rb#L65)
1501
+
1502
+ ### Ably::Realtime::Channel
1503
+ _(see [spec/unit/realtime/channel_spec.rb](./spec/unit/realtime/channel_spec.rb))_
1504
+ * #initializer
1505
+ * as UTF_8 string
1506
+ * [is permitted](./spec/unit/realtime/channel_spec.rb#L19)
1507
+ * [remains as UTF-8](./spec/unit/realtime/channel_spec.rb#L23)
1508
+ * as SHIFT_JIS string
1509
+ * [gets converted to UTF-8](./spec/unit/realtime/channel_spec.rb#L31)
1510
+ * [is compatible with original encoding](./spec/unit/realtime/channel_spec.rb#L35)
1511
+ * as ASCII_8BIT string
1512
+ * [gets converted to UTF-8](./spec/unit/realtime/channel_spec.rb#L43)
1513
+ * [is compatible with original encoding](./spec/unit/realtime/channel_spec.rb#L47)
1514
+ * as Integer
1515
+ * [raises an argument error](./spec/unit/realtime/channel_spec.rb#L55)
1516
+ * as Nil
1517
+ * [raises an argument error](./spec/unit/realtime/channel_spec.rb#L63)
1518
+ * #publish name argument
1519
+ * as UTF_8 string
1520
+ * [is permitted](./spec/unit/realtime/channel_spec.rb#L79)
1521
+ * as SHIFT_JIS string
1522
+ * [is permitted](./spec/unit/realtime/channel_spec.rb#L87)
1523
+ * as ASCII_8BIT string
1524
+ * [is permitted](./spec/unit/realtime/channel_spec.rb#L95)
1525
+ * as Integer
1526
+ * [raises an argument error](./spec/unit/realtime/channel_spec.rb#L103)
1527
+ * as Nil
1528
+ * [raises an argument error](./spec/unit/realtime/channel_spec.rb#L111)
1529
+ * callbacks
1530
+ * [are supported for valid STATE events](./spec/unit/realtime/channel_spec.rb#L118)
1531
+ * [fail with unacceptable STATE event names](./spec/unit/realtime/channel_spec.rb#L124)
1532
+ * subscriptions
1533
+ * #subscribe
1534
+ * [to all events](./spec/unit/realtime/channel_spec.rb#L159)
1535
+ * [to specific events](./spec/unit/realtime/channel_spec.rb#L165)
1536
+ * #unsubscribe
1537
+ * [to all events](./spec/unit/realtime/channel_spec.rb#L181)
1538
+ * [to specific events](./spec/unit/realtime/channel_spec.rb#L187)
1539
+ * [to specific non-matching events](./spec/unit/realtime/channel_spec.rb#L193)
1540
+ * [all callbacks by not providing a callback](./spec/unit/realtime/channel_spec.rb#L199)
1541
+
1542
+ ### Ably::Realtime::Channels
1543
+ _(see [spec/unit/realtime/channels_spec.rb](./spec/unit/realtime/channels_spec.rb))_
1544
+ * creating channels
1545
+ * [#get creates a channel](./spec/unit/realtime/channels_spec.rb#L13)
1546
+ * [#get will reuse the channel object](./spec/unit/realtime/channels_spec.rb#L18)
1547
+ * [[] creates a channel](./spec/unit/realtime/channels_spec.rb#L24)
1548
+ * #fetch
1549
+ * [retrieves a channel if it exists](./spec/unit/realtime/channels_spec.rb#L31)
1550
+ * [calls the block if channel is missing](./spec/unit/realtime/channels_spec.rb#L36)
1551
+ * destroying channels
1552
+ * [#release detatches and then releases the channel resoures](./spec/unit/realtime/channels_spec.rb#L44)
1553
+ * is Enumerable
1554
+ * [allows enumeration](./spec/unit/realtime/channels_spec.rb#L61)
1555
+ * [provides #length](./spec/unit/realtime/channels_spec.rb#L77)
1556
+ * #each
1557
+ * [returns an enumerator](./spec/unit/realtime/channels_spec.rb#L66)
1558
+ * [yields each channel](./spec/unit/realtime/channels_spec.rb#L70)
1559
+
1560
+ ### Ably::Realtime::Client
1561
+ _(see [spec/unit/realtime/client_spec.rb](./spec/unit/realtime/client_spec.rb))_
1562
+ * behaves like a client initializer
1563
+ * with invalid arguments
1564
+ * empty hash
1565
+ * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L28)
1566
+ * nil
1567
+ * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L36)
1568
+ * api_key: "invalid"
1569
+ * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L44)
1570
+ * api_key: "invalid:asdad"
1571
+ * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L52)
1572
+ * api_key and key_id
1573
+ * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L60)
1574
+ * api_key and key_secret
1575
+ * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L68)
1576
+ * client_id as only option
1577
+ * [requires a valid key](./spec/shared/client_initializer_behaviour.rb#L76)
1578
+ * with valid arguments
1579
+ * api_key only
1580
+ * [connects to the Ably service](./spec/shared/client_initializer_behaviour.rb#L87)
1581
+ * key_id and key_secret
1582
+ * [constructs an api_key](./spec/shared/client_initializer_behaviour.rb#L95)
1583
+ * with a string key instead of options hash
1584
+ * [sets the api_key](./spec/shared/client_initializer_behaviour.rb#L103)
1585
+ * [sets the key_id](./spec/shared/client_initializer_behaviour.rb#L107)
1586
+ * [sets the key_secret](./spec/shared/client_initializer_behaviour.rb#L111)
1587
+ * with token
1588
+ * [sets the token_id](./spec/shared/client_initializer_behaviour.rb#L119)
1589
+ * endpoint
1590
+ * [defaults to production](./spec/shared/client_initializer_behaviour.rb#L125)
1591
+ * with environment option
1592
+ * [uses an alternate endpoint](./spec/shared/client_initializer_behaviour.rb#L132)
1593
+ * tls
1594
+ * [defaults to TLS](./spec/shared/client_initializer_behaviour.rb#L151)
1595
+ * set to false
1596
+ * [uses plain text](./spec/shared/client_initializer_behaviour.rb#L142)
1597
+ * [uses HTTP](./spec/shared/client_initializer_behaviour.rb#L146)
1598
+ * logger
1599
+ * default
1600
+ * [uses Ruby Logger](./spec/shared/client_initializer_behaviour.rb#L158)
1601
+ * [specifies Logger::ERROR log level](./spec/shared/client_initializer_behaviour.rb#L162)
1602
+ * with log_level :none
1603
+ * [silences all logging with a NilLogger](./spec/shared/client_initializer_behaviour.rb#L170)
1604
+ * with custom logger and log_level
1605
+ * [uses the custom logger](./spec/shared/client_initializer_behaviour.rb#L188)
1606
+ * [sets the custom log level](./spec/shared/client_initializer_behaviour.rb#L192)
1607
+ * delegators
1608
+ * [delegates :client_id to .auth](./spec/shared/client_initializer_behaviour.rb#L202)
1609
+ * [delegates :auth_options to .auth](./spec/shared/client_initializer_behaviour.rb#L207)
1610
+ * delegation to the REST Client
1611
+ * [passes on the options to the initializer](./spec/unit/realtime/client_spec.rb#L15)
1612
+ * for attribute
1613
+ * [#environment](./spec/unit/realtime/client_spec.rb#L23)
1614
+ * [#use_tls?](./spec/unit/realtime/client_spec.rb#L23)
1615
+ * [#log_level](./spec/unit/realtime/client_spec.rb#L23)
1616
+ * [#custom_host](./spec/unit/realtime/client_spec.rb#L23)
1617
+
1618
+ ### Ably::Realtime::Connection
1619
+ _(see [spec/unit/realtime/connection_spec.rb](./spec/unit/realtime/connection_spec.rb))_
1620
+ * callbacks
1621
+ * [are supported for valid STATE events](./spec/unit/realtime/connection_spec.rb#L18)
1622
+ * [fail with unacceptable STATE event names](./spec/unit/realtime/connection_spec.rb#L24)
1623
+
1624
+ ### Ably::Realtime::Presence
1625
+ _(see [spec/unit/realtime/presence_spec.rb](./spec/unit/realtime/presence_spec.rb))_
1626
+ * callbacks
1627
+ * [are supported for valid STATE events](./spec/unit/realtime/presence_spec.rb#L13)
1628
+ * [fail with unacceptable STATE event names](./spec/unit/realtime/presence_spec.rb#L19)
1629
+ * subscriptions
1630
+ * #subscribe
1631
+ * [to all presence state actions](./spec/unit/realtime/presence_spec.rb#L60)
1632
+ * [to specific presence state actions](./spec/unit/realtime/presence_spec.rb#L66)
1633
+ * #unsubscribe
1634
+ * [to all presence state actions](./spec/unit/realtime/presence_spec.rb#L86)
1635
+ * [to specific presence state actions](./spec/unit/realtime/presence_spec.rb#L92)
1636
+ * [to specific non-matching presence state actions](./spec/unit/realtime/presence_spec.rb#L98)
1637
+ * [all callbacks by not providing a callback](./spec/unit/realtime/presence_spec.rb#L104)
1638
+
1639
+ ### Ably::Realtime
1640
+ _(see [spec/unit/realtime/realtime_spec.rb](./spec/unit/realtime/realtime_spec.rb))_
1641
+ * [constructor returns an Ably::Realtime::Client](./spec/unit/realtime/realtime_spec.rb#L6)
1642
+
1643
+ ### Ably::Rest::Channels
1644
+ _(see [spec/unit/rest/channel_spec.rb](./spec/unit/rest/channel_spec.rb))_
1645
+ * #initializer
1646
+ * as UTF_8 string
1647
+ * [is permitted](./spec/unit/rest/channel_spec.rb#L16)
1648
+ * [remains as UTF-8](./spec/unit/rest/channel_spec.rb#L20)
1649
+ * as SHIFT_JIS string
1650
+ * [gets converted to UTF-8](./spec/unit/rest/channel_spec.rb#L28)
1651
+ * [is compatible with original encoding](./spec/unit/rest/channel_spec.rb#L32)
1652
+ * as ASCII_8BIT string
1653
+ * [gets converted to UTF-8](./spec/unit/rest/channel_spec.rb#L40)
1654
+ * [is compatible with original encoding](./spec/unit/rest/channel_spec.rb#L44)
1655
+ * as Integer
1656
+ * [raises an argument error](./spec/unit/rest/channel_spec.rb#L52)
1657
+ * as Nil
1658
+ * [raises an argument error](./spec/unit/rest/channel_spec.rb#L60)
1659
+ * #publish name argument
1660
+ * as UTF_8 string
1661
+ * [is permitted](./spec/unit/rest/channel_spec.rb#L72)
1662
+ * as SHIFT_JIS string
1663
+ * [is permitted](./spec/unit/rest/channel_spec.rb#L80)
1664
+ * as ASCII_8BIT string
1665
+ * [is permitted](./spec/unit/rest/channel_spec.rb#L88)
1666
+ * as Integer
1667
+ * [raises an argument error](./spec/unit/rest/channel_spec.rb#L96)
1668
+ * as Nil
1669
+ * [raises an argument error](./spec/unit/rest/channel_spec.rb#L104)
1670
+
1671
+ ### Ably::Rest::Channels
1672
+ _(see [spec/unit/rest/channels_spec.rb](./spec/unit/rest/channels_spec.rb))_
1673
+ * creating channels
1674
+ * [#get creates a channel](./spec/unit/rest/channels_spec.rb#L12)
1675
+ * [#get will reuse the channel object](./spec/unit/rest/channels_spec.rb#L17)
1676
+ * [[] creates a channel](./spec/unit/rest/channels_spec.rb#L23)
1677
+ * #fetch
1678
+ * [retrieves a channel if it exists](./spec/unit/rest/channels_spec.rb#L30)
1679
+ * [calls the block if channel is missing](./spec/unit/rest/channels_spec.rb#L35)
1680
+ * destroying channels
1681
+ * [#release releases the channel resoures](./spec/unit/rest/channels_spec.rb#L43)
1682
+ * is Enumerable
1683
+ * [allows enumeration](./spec/unit/rest/channels_spec.rb#L59)
1684
+ * [provides #length](./spec/unit/rest/channels_spec.rb#L75)
1685
+ * #each
1686
+ * [returns an enumerator](./spec/unit/rest/channels_spec.rb#L64)
1687
+ * [yields each channel](./spec/unit/rest/channels_spec.rb#L68)
1688
+
1689
+ ### Ably::Rest::Client
1690
+ _(see [spec/unit/rest/client_spec.rb](./spec/unit/rest/client_spec.rb))_
1691
+ * behaves like a client initializer
1692
+ * with invalid arguments
1693
+ * empty hash
1694
+ * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L28)
1695
+ * nil
1696
+ * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L36)
1697
+ * api_key: "invalid"
1698
+ * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L44)
1699
+ * api_key: "invalid:asdad"
1700
+ * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L52)
1701
+ * api_key and key_id
1702
+ * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L60)
1703
+ * api_key and key_secret
1704
+ * [raises an exception](./spec/shared/client_initializer_behaviour.rb#L68)
1705
+ * client_id as only option
1706
+ * [requires a valid key](./spec/shared/client_initializer_behaviour.rb#L76)
1707
+ * with valid arguments
1708
+ * api_key only
1709
+ * [connects to the Ably service](./spec/shared/client_initializer_behaviour.rb#L87)
1710
+ * key_id and key_secret
1711
+ * [constructs an api_key](./spec/shared/client_initializer_behaviour.rb#L95)
1712
+ * with a string key instead of options hash
1713
+ * [sets the api_key](./spec/shared/client_initializer_behaviour.rb#L103)
1714
+ * [sets the key_id](./spec/shared/client_initializer_behaviour.rb#L107)
1715
+ * [sets the key_secret](./spec/shared/client_initializer_behaviour.rb#L111)
1716
+ * with token
1717
+ * [sets the token_id](./spec/shared/client_initializer_behaviour.rb#L119)
1718
+ * endpoint
1719
+ * [defaults to production](./spec/shared/client_initializer_behaviour.rb#L125)
1720
+ * with environment option
1721
+ * [uses an alternate endpoint](./spec/shared/client_initializer_behaviour.rb#L132)
1722
+ * tls
1723
+ * [defaults to TLS](./spec/shared/client_initializer_behaviour.rb#L151)
1724
+ * set to false
1725
+ * [uses plain text](./spec/shared/client_initializer_behaviour.rb#L142)
1726
+ * [uses HTTP](./spec/shared/client_initializer_behaviour.rb#L146)
1727
+ * logger
1728
+ * default
1729
+ * [uses Ruby Logger](./spec/shared/client_initializer_behaviour.rb#L158)
1730
+ * [specifies Logger::ERROR log level](./spec/shared/client_initializer_behaviour.rb#L162)
1731
+ * with log_level :none
1732
+ * [silences all logging with a NilLogger](./spec/shared/client_initializer_behaviour.rb#L170)
1733
+ * with custom logger and log_level
1734
+ * [uses the custom logger](./spec/shared/client_initializer_behaviour.rb#L188)
1735
+ * [sets the custom log level](./spec/shared/client_initializer_behaviour.rb#L192)
1736
+ * delegators
1737
+ * [delegates :client_id to .auth](./spec/shared/client_initializer_behaviour.rb#L202)
1738
+ * [delegates :auth_options to .auth](./spec/shared/client_initializer_behaviour.rb#L207)
1739
+ * initializer options
1740
+ * TLS
1741
+ * disabled
1742
+ * [fails for any operation with basic auth and attempting to send an API key over a non-secure connection](./spec/unit/rest/client_spec.rb#L17)
1743
+ * :use_token_auth
1744
+ * set to false
1745
+ * with an api_key with :tls => false
1746
+ * [fails for any operation with basic auth and attempting to send an API key over a non-secure connection](./spec/unit/rest/client_spec.rb#L28)
1747
+ * without an api_key
1748
+ * [fails as an api_key is required if not using token auth](./spec/unit/rest/client_spec.rb#L36)
1749
+ * set to true
1750
+ * without an api_key or token_id
1751
+ * [fails as an api_key is required to issue tokens](./spec/unit/rest/client_spec.rb#L46)
1752
+
1753
+ ### Ably::Rest
1754
+ _(see [spec/unit/rest/rest_spec.rb](./spec/unit/rest/rest_spec.rb))_
1755
+ * [constructor returns an Ably::Rest::Client](./spec/unit/rest/rest_spec.rb#L7)
1756
+
1757
+ ### Ably::Util::Crypto
1758
+ _(see [spec/unit/util/crypto_spec.rb](./spec/unit/util/crypto_spec.rb))_
1759
+ * defaults
1760
+ * [match other client libraries](./spec/unit/util/crypto_spec.rb#L18)
1761
+ * encrypts & decrypt
1762
+ * [#encrypt encrypts a string](./spec/unit/util/crypto_spec.rb#L28)
1763
+ * [#decrypt decrypts a string](./spec/unit/util/crypto_spec.rb#L33)
1764
+ * encrypting an empty string
1765
+ * [raises an ArgumentError](./spec/unit/util/crypto_spec.rb#L42)
1766
+ * using shared client lib fixture data
1767
+ * with AES-128-CBC
1768
+ * behaves like an Ably encrypter and decrypter
1769
+ * text payload
1770
+ * [encrypts exactly the same binary data as other client libraries](./spec/unit/util/crypto_spec.rb#L65)
1771
+ * [decrypts exactly the same binary data as other client libraries](./spec/unit/util/crypto_spec.rb#L69)
1772
+ * with AES-256-CBC
1773
+ * behaves like an Ably encrypter and decrypter
1774
+ * text payload
1775
+ * [encrypts exactly the same binary data as other client libraries](./spec/unit/util/crypto_spec.rb#L65)
1776
+ * [decrypts exactly the same binary data as other client libraries](./spec/unit/util/crypto_spec.rb#L69)
1777
+
1778
+ ### Ably::Util::PubSub
1779
+ _(see [spec/unit/util/pub_sub_spec.rb](./spec/unit/util/pub_sub_spec.rb))_
1780
+ * event fan out
1781
+ * [#publish allows publishing to more than on subscriber](./spec/unit/util/pub_sub_spec.rb#L11)
1782
+ * [#publish sends only messages to #subscribe callbacks matching event names](./spec/unit/util/pub_sub_spec.rb#L19)
1783
+ * #unsubscribe
1784
+ * [deletes matching callbacks](./spec/unit/util/pub_sub_spec.rb#L71)
1785
+ * [deletes all callbacks if not block given](./spec/unit/util/pub_sub_spec.rb#L76)
1786
+ * [continues if the block does not exist](./spec/unit/util/pub_sub_spec.rb#L81)
1787
+
1788
+ -------
1789
+
1790
+ ## Test summary
1791
+
1792
+ * Passing tests: 864
1793
+ * Pending tests: 11
1794
+ * Failing tests: 0