Sha256: 27ceb8faab6afdcbee65939d3d30a132ab106daaa7909e376b28a48e039d69b4

Contents?: true

Size: 605 Bytes

Versions: 19

Compression:

Stored size: 605 Bytes

Contents

RSpec.configure do |config|
  config.before(:example) do
    @log_output = []
    %w(fatal error warn info debug).each do |method_name|
      allow_any_instance_of(Ably::Logger).to receive(method_name.to_sym).and_wrap_original do |method, *args|
        @log_output << "#{Time.now.strftime('%H:%M:%S.%L')} [\e[33m#{method_name}\e[0m] #{args[0]}"
        method.call(*args)
      end
    end
  end

  config.after(:example) do |example|
    exception = example.exception
    puts "\n#{'-'*34}\n\e[36mVerbose Ably log from test failure\e[0m\n#{'-'*34}\n#{@log_output.join("\n")}\n\n" if exception
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
ably-rest-0.8.15 lib/submodules/ably-ruby/spec/support/debug_failure_helper.rb
ably-0.8.15 spec/support/debug_failure_helper.rb
ably-rest-0.9.3 lib/submodules/ably-ruby/spec/support/debug_failure_helper.rb
ably-rest-0.9.2 lib/submodules/ably-ruby/spec/support/debug_failure_helper.rb
ably-rest-0.9.1 lib/submodules/ably-ruby/spec/support/debug_failure_helper.rb
ably-rest-0.9.0 lib/submodules/ably-ruby/spec/support/debug_failure_helper.rb
ably-rest-0.8.14 lib/submodules/ably-ruby/spec/support/debug_failure_helper.rb
ably-0.8.14 spec/support/debug_failure_helper.rb
ably-rest-0.8.13 lib/submodules/ably-ruby/spec/support/debug_failure_helper.rb
ably-0.8.13 spec/support/debug_failure_helper.rb
ably-0.8.12 spec/support/debug_failure_helper.rb
ably-0.8.11 spec/support/debug_failure_helper.rb
ably-0.8.10 spec/support/debug_failure_helper.rb
ably-rest-0.8.9 lib/submodules/ably-ruby/spec/support/debug_failure_helper.rb
ably-0.8.9 spec/support/debug_failure_helper.rb
ably-0.8.8 spec/support/debug_failure_helper.rb
ably-0.8.7 spec/support/debug_failure_helper.rb
ably-0.8.6 spec/support/debug_failure_helper.rb
ably-rest-0.8.6 lib/submodules/ably-ruby/spec/support/debug_failure_helper.rb