Sha256: 130a0a7f4f9e65172a448d38a9fcc815024a998064f0d6028eab8dfc891cbfd5

Contents?: true

Size: 834 Bytes

Versions: 1

Compression:

Stored size: 834 Bytes

Contents

# encoding: utf-8

require_relative '../../minitest_helper'
require 'strike/obfuscator'

describe Strike::Obfuscator do
  let(:input)  { Object.new }
  let(:output) { Object.new }
  let(:tables) { { users: :keep, movies: :keep } }
  let(:adapter_mock) do
    MiniTest::Mock.new.
      expect(:globally_kept_columns=, true, [%w(id created_at updated_at)]).
      expect(:obfuscate, true, [input, output])
  end
  let(:adapter_source) do
    MiniTest::Mock.new.expect(:call, adapter_mock, [tables])
  end

  let(:obfuscator) { Strike::Obfuscator.new(adapter_source: adapter_source) }

  subject { obfuscator }

  describe '#call' do
    it 'should prepare the adapter and call it' do
      subject.call(tables, input, output).must_equal true
    end

    after do
      adapter_source.verify
      adapter_mock.verify
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
strike-0.4.0 spec/lib/strike/obfuscator_spec.rb