Replace couchbase counters with drb version

This commit is contained in:
2014-08-05 17:49:16 +02:00
parent c0c25673bf
commit 99a9536c68
20 changed files with 400 additions and 282 deletions
@@ -14,6 +14,7 @@ module Matchers
def initialize(user_id)
@user_id = user_id
@user_id = @user_id.id if @user_id.is_a?(User)
end
def matches?(block)
@@ -24,8 +25,9 @@ module Matchers
Qwaiter.broadcaster = old_broadcaster
relevant_broadcasts = test_broadcaster.broadcasts.select{|b| b[:channel] =~ /^\/user\/#{@user_id}/ && b[:data][:event] == @message}
@failure_message = "User #{@user_id} did not receive any broadcasts" and return false if relevant_broadcasts.empty?
@failure_debug_content = "was #{relevant_broadcasts.map{|b| b[:data][:data].inspect}.join(" and ")}"
relevant_broadcasts.any?{|b| @target_object === b[:data][:data]}
relevant_broadcasts.any? { |b| @target_object === b[:data][:data] }
end
def message(msg)
@@ -39,7 +41,7 @@ module Matchers
end
def failure_message
"user #{@user_id} did not receive broadcast #{@message} with #{@target_object.inspect} #{@failure_debug_content}"
@failure_message || "user #{@user_id} did not receive broadcast #{@message} with #{@target_object.inspect} #{@failure_debug_content}"
end
def supports_block_expectations?; true; end
end