Sha256: 4abdaa9f9bf0d7c918a1e7ab340f98fb7307798a5761043e5bc8c86a7d8deb9c

Contents?: true

Size: 879 Bytes

Versions: 7

Compression:

Stored size: 879 Bytes

Contents

require 'spec_helper'

describe Ougai::Logging do
  subject do
    m = described_class
    Class.new { include m }.new
  end

  describe '#weak_merge!' do
    it 'merges with unique elements in array' do
      result = nil
      subject.instance_eval do
        result = weak_merge!({ foo: [1, 2], bar: 'base', baz: ['A'] },
                             { foo: [2, 3], bar: 'inferior', baz: ['B'] })
      end
      expect(result[:foo]).to eq([2, 3, 1])
      expect(result[:bar]).to eq('base')
      expect(result[:baz]).to eq(['B', 'A'])
    end
  end

  describe '#chain' do
    it 'is not implemented' do
      expect{ subject.chain(:arg1, :arg2, :arg3, :arg4) }.to raise_error(NotImplementedError)
    end
  end

  describe '#append' do
    it 'is not implemented' do
      expect{ subject.send(:append, :arg1, :arg2) }.to raise_error(NotImplementedError)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ougai-1.8.5 spec/logging_spec.rb
ougai-1.8.4 spec/logging_spec.rb
ougai-1.8.3 spec/logging_spec.rb
ougai-1.8.2 spec/logging_spec.rb
ougai-1.8.1 spec/logging_spec.rb
ougai-1.8.0-java spec/logging_spec.rb
ougai-1.8.0 spec/logging_spec.rb