Sha256: 91dab2d82b465c2a2123fa96d90d1e4ad215027c39b798b5af88313958dd8ff8

Contents?: true

Size: 890 Bytes

Versions: 24

Compression:

Stored size: 890 Bytes

Contents

require 'spec_helper'

if RUBY_PLATFORM != 'opal'
  describe TaskArgumentFilterer do
    it 'should filter arguments' do
      filtered_args = TaskArgumentFilterer.new(login: 'jim@jim.com', password: 'some password no one should see').run

      expect(filtered_args).to eq(login: 'jim@jim.com', password: '[FILTERED]')
    end

    it 'should filter in nested args' do
      filtered_args = TaskArgumentFilterer.new([:login, { login: 'jim@jim.com', password: 'some password' }]).run

      expect(filtered_args).to eq([:login, { login: 'jim@jim.com', password: '[FILTERED]' }])
    end

    it 'should create and run a new TaskArgumentFilterer when its filter method is called' do
      filtered_args = TaskArgumentFilterer.filter([{login: 'jam@jam.com', password: 'some password'}])
      expect(filtered_args).to eq([{:login=>"jam@jam.com", :password=>"[FILTERED]"}])
    end

  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
volt-0.9.3.pre4 spec/utils/task_argument_filtererer_spec.rb
volt-0.9.3.pre3 spec/utils/task_argument_filtererer_spec.rb
volt-0.9.3.pre2 spec/utils/task_argument_filtererer_spec.rb
volt-0.9.3.pre1 spec/utils/task_argument_filtererer_spec.rb