Sha256: dc6cbdce1a30e2098e8332f59ccc36b3cb206a8d29ead02c387f79da5c505b73

Contents?: true

Size: 859 Bytes

Versions: 92

Compression:

Stored size: 859 Bytes

Contents

require 'spec_helper'
require 'flydata/command/encrypt'

module Flydata
  module Command
    describe Encrypt do
      subject { described_class.new }
      let(:flydata) { double('flydata') }
      let(:data_port) { double('data_port') }
      let(:key) { 'abcd' }
      let(:dp) { {'key' => key} }
      let(:password) { 'P@ssword' }
      let(:encrypted_password) { '@#$@#' }

      before do
        expect(subject).to receive(:flydata).and_return(flydata)
        expect(flydata).to receive(:data_port).and_return(data_port)
        expect(data_port).to receive(:get).and_return(dp)
        expect(subject).to receive(:ask).and_return(password)
      end
      it "loads without an error" do
        expect(Flydata::Util::Encryptor).to receive(:encrypt).with(password, key).and_return(encrypted_password)

        subject.run
      end
    end
  end
end

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
flydata-0.8.10.2 spec/flydata/command/encrypt_spec.rb
flydata-0.8.10.1 spec/flydata/command/encrypt_spec.rb
flydata-0.8.9.11 spec/flydata/command/encrypt_spec.rb
flydata-0.8.10 spec/flydata/command/encrypt_spec.rb
flydata-0.8.9 spec/flydata/command/encrypt_spec.rb
flydata-0.8.8 spec/flydata/command/encrypt_spec.rb
flydata-0.8.7 spec/flydata/command/encrypt_spec.rb
flydata-0.8.6 spec/flydata/command/encrypt_spec.rb
flydata-0.8.5 spec/flydata/command/encrypt_spec.rb
flydata-0.8.4 spec/flydata/command/encrypt_spec.rb
flydata-0.8.3 spec/flydata/command/encrypt_spec.rb
flydata-0.8.2 spec/flydata/command/encrypt_spec.rb
flydata-0.8.1 spec/flydata/command/encrypt_spec.rb
flydata-0.8.0 spec/flydata/command/encrypt_spec.rb
flydata-0.7.19 spec/flydata/command/encrypt_spec.rb
flydata-0.7.18 spec/flydata/command/encrypt_spec.rb
flydata-0.7.17 spec/flydata/command/encrypt_spec.rb
flydata-0.7.16 spec/flydata/command/encrypt_spec.rb
flydata-0.7.15 spec/flydata/command/encrypt_spec.rb
flydata-0.7.14 spec/flydata/command/encrypt_spec.rb