Sha256: 06ead7f770ed489bc8a151d58cc058d2a85a3d86c8426a199bdec18af85a9c75

Contents?: true

Size: 639 Bytes

Versions: 1

Compression:

Stored size: 639 Bytes

Contents

require 'spec_helper'

class DumbLogger
  def info(msg)
    puts msg
  end
end

describe LazyResource do
  before :each do
    LazyResource.configure do |config|
      config.debug = true
      config.logger = DumbLogger.new
    end
  end

  describe '#logger' do
    it 'returns the logger' do
      LazyResource.logger.should_not be_nil
    end
  end

  describe '#debug' do
    it 'logs when a request completes' do
      LazyResource.logger.should_receive(:info)
      request = LazyResource::Request.new('http://example.com', User.new)
      request.response = Typhoeus::Response.new
      request.execute_callbacks
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lazy_resource-0.4.0 spec/lazy_resource/lazy_resource_spec.rb