diff options
Diffstat (limited to 'actioncable/test/stubs/test_connection.rb')
-rw-r--r-- | actioncable/test/stubs/test_connection.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/actioncable/test/stubs/test_connection.rb b/actioncable/test/stubs/test_connection.rb new file mode 100644 index 0000000000..384abc5e76 --- /dev/null +++ b/actioncable/test/stubs/test_connection.rb @@ -0,0 +1,21 @@ +require 'stubs/user' + +class TestConnection + attr_reader :identifiers, :logger, :current_user, :transmissions + + def initialize(user = User.new("lifo")) + @identifiers = [ :current_user ] + + @current_user = user + @logger = ActiveSupport::TaggedLogging.new ActiveSupport::Logger.new(StringIO.new) + @transmissions = [] + end + + def transmit(data) + @transmissions << data + end + + def last_transmission + @transmissions.last + end +end |