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.5.8 spec/flydata/command/encrypt_spec.rb
flydata-0.5.7 spec/flydata/command/encrypt_spec.rb
flydata-0.5.6 spec/flydata/command/encrypt_spec.rb
flydata-0.5.5 spec/flydata/command/encrypt_spec.rb
flydata-0.5.4 spec/flydata/command/encrypt_spec.rb
flydata-0.5.3 spec/flydata/command/encrypt_spec.rb
flydata-0.5.2 spec/flydata/command/encrypt_spec.rb
flydata-0.5.1 spec/flydata/command/encrypt_spec.rb
flydata-0.5.0 spec/flydata/command/encrypt_spec.rb
flydata-0.4.3 spec/flydata/command/encrypt_spec.rb
flydata-0.4.2 spec/flydata/command/encrypt_spec.rb
flydata-0.4.1 spec/flydata/command/encrypt_spec.rb
flydata-0.4.0 spec/flydata/command/encrypt_spec.rb
flydata-0.3.24 spec/flydata/command/encrypt_spec.rb
flydata-0.3.23 spec/flydata/command/encrypt_spec.rb
flydata-0.3.22 spec/flydata/command/encrypt_spec.rb
flydata-0.3.21 spec/flydata/command/encrypt_spec.rb
flydata-0.3.20 spec/flydata/command/encrypt_spec.rb
flydata-0.3.19 spec/flydata/command/encrypt_spec.rb
flydata-0.3.18 spec/flydata/command/encrypt_spec.rb