aboutsummaryrefslogtreecommitdiffstats
path: root/test/stubs/test_connection.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/stubs/test_connection.rb')
-rw-r--r--test/stubs/test_connection.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/stubs/test_connection.rb b/test/stubs/test_connection.rb
new file mode 100644
index 0000000000..1c353f9ee3
--- /dev/null
+++ b/test/stubs/test_connection.rb
@@ -0,0 +1,26 @@
+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
+
+ # Disable async in tests
+ def send_async(method, *arguments)
+ send method, *arguments
+ end
+end