Sha256: 06311e83b81cb187741ca418cb830e68681e1c9c1d6367378f4f59372e3be6c1

Contents?: true

Size: 1.2 KB

Versions: 30

Compression:

Stored size: 1.2 KB

Contents

RSpec.describe Percy do
  before(:each) { Percy.reset }
  after(:each) { Percy.reset }
  describe '#config' do
    it 'returns a config object' do
      expect(Percy.config.api_url).to eq('http://localhost:3000/api/v1')
    end
  end
  describe '#client' do
    it 'returns a Percy::Client that is passed the global config object by default' do
      config = Percy.config
      expect(Percy.client.config).to eq(config)
    end
  end
  describe '#logger' do
    it 'returns a memoized logger instance' do
      logger = Percy.logger
      expect(logger).to eq(Percy.logger)
      Percy.logger.debug('Test logging that should NOT be output')
      Percy.logger.info('Test logging that SHOULD be output')
      Percy.logger.error('Test logging that SHOULD be output')
      Percy.config.debug = true
      Percy.logger.debug('Test logging that SHOULD be output')
    end
  end
  describe '#reset' do
    it 'clears certain instance variables' do
      old_config = Percy.client.config
      old_client = Percy.client
      old_logger = Percy.logger
      Percy.reset
      expect(old_config).to_not eq(Percy.config)
      expect(old_client).to_not eq(Percy.client)
      expect(old_logger).to_not eq(Percy.logger)
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
percy-client-2.1.1 spec/lib/percy_spec.rb
percy-client-2.1.0 spec/lib/percy_spec.rb
percy-client-2.0.9 spec/lib/percy_spec.rb
percy-client-2.0.8 spec/lib/percy_spec.rb
percy-client-2.0.7 spec/lib/percy_spec.rb
percy-client-2.0.6 spec/lib/percy_spec.rb
percy-client-2.0.5 spec/lib/percy_spec.rb
percy-client-2.0.4 spec/lib/percy_spec.rb
percy-client-2.0.3 spec/lib/percy_spec.rb
percy-client-2.0.2 spec/lib/percy_spec.rb
percy-client-2.0.1 spec/lib/percy_spec.rb
percy-client-2.0.0 spec/lib/percy_spec.rb
percy-client-1.15.0 spec/lib/percy_spec.rb
percy-client-1.14.1 spec/lib/percy_spec.rb
percy-client-1.14.0 spec/lib/percy_spec.rb
percy-client-1.13.10 spec/lib/percy_spec.rb
percy-client-1.13.9 spec/lib/percy_spec.rb
percy-client-1.13.8 spec/lib/percy_spec.rb
percy-client-1.13.7 spec/lib/percy_spec.rb
percy-client-1.13.6 spec/lib/percy_spec.rb