Sha256: 246c0af98060a2c502104f3eb9e431726120def0bb0fd77fee2df2ef649ab1d2

Contents?: true

Size: 709 Bytes

Versions: 8

Compression:

Stored size: 709 Bytes

Contents

require 'spec_helper'

describe Shb::Client do
  before do
    stub_request(:any, 'supremegolf.com')
  end

  it "logs to STDERR by default" do
    expect(::Logger).to receive(:new).with(STDERR).and_call_original
    shb = Shb::Client.new
    shb.get('/')
  end

  it "logs to custom location if specified" do
    expect(::Logger).to receive(:new).with(STDOUT).and_call_original
    shb = Shb::Client.new
    shb.config.logger = STDOUT
    shb.get('/')
  end

  it "logs to Rails.root/tmp/shb.log if using Rails" do
    skip "How to double ::Rails and ::Rails.root?"
    shb = Shb::Client.new
    expect(::Logger).to receive(:new).with('rails-root/log/shb.log').and_call_original
    shb.get('/')
  end


end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
shb-0.1.4 spec/logger_spec.rb
shb-0.1.3 spec/logger_spec.rb
shb-0.1.2 spec/logger_spec.rb
shb-0.1.1 spec/logger_spec.rb
shb-0.1.0 spec/logger_spec.rb
shb-0.0.4 spec/logger_spec.rb
shb-0.0.3 spec/logger_spec.rb
shb-0.0.2 spec/logger_spec.rb