Sha256: df02a42b61628ca807e573411f74fa747e1257a0ccf3fae47aeb1a08ee52164a

Contents?: true

Size: 743 Bytes

Versions: 5

Compression:

Stored size: 743 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'fileutils'
require 'digest'

describe Travis::CLI::EncryptFile do
  CMD_TARGET = 'README.md'

  before do
    Digest.stub(:hexencode).and_return 'randomhex' # to avoid relying on Dir.pwd value for hex
  end

  after do
    FileUtils.rm_f "#{CMD_TARGET}.enc"
  end

  example "travis encrypt-file #{CMD_TARGET}" do
    run_cli('encrypt-file', CMD_TARGET).should be_success
    File.exist?("#{CMD_TARGET}.enc").should be true
  end

  example "travis encrypt-file #{CMD_TARGET} -a" do
    run_cli('encrypt-file', CMD_TARGET, '-a') { |i| i.puts 'n' }.should be_success
    stdout.should match(/Overwrite the config file/)
    File.exist?("#{CMD_TARGET}.enc").should be true
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
travis-1.13.3 spec/cli/encrypt_file_spec.rb
travis-1.13.2 spec/cli/encrypt_file_spec.rb
travis-1.13.1 spec/cli/encrypt_file_spec.rb
travis-1.13.0 spec/cli/encrypt_file_spec.rb
travis-1.12.0 spec/cli/encrypt_file_spec.rb