Sha256: eb7d675e6058d9d8186cff75fddfffdf3ba55381d7f836c207595305dd15e28c

Contents?: true

Size: 725 Bytes

Versions: 55

Compression:

Stored size: 725 Bytes

Contents

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

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

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

  after :each 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.exists?("#{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.exists?("#{CMD_TARGET}.enc").should be true
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
travis-1.8.14.travis.1178.9 spec/cli/encrypt_file_spec.rb
travis-1.8.14.travis.1175.9 spec/cli/encrypt_file_spec.rb
travis-1.8.14.travis.1172.9 spec/cli/encrypt_file_spec.rb
travis-1.8.14.travis.1164.9 spec/cli/encrypt_file_spec.rb
travis-1.8.14.travis.1163.9 spec/cli/encrypt_file_spec.rb
travis-1.8.14.travis.1162.9 spec/cli/encrypt_file_spec.rb
travis-1.8.14.travis.1160.9 spec/cli/encrypt_file_spec.rb
travis-1.8.13 spec/cli/encrypt_file_spec.rb
travis-1.8.14.travis.1156.9 spec/cli/encrypt_file_spec.rb
travis-1.8.14.travis.1155.9 spec/cli/encrypt_file_spec.rb
travis-1.8.13.travis.1152.9 spec/cli/encrypt_file_spec.rb
travis-1.8.13.travis.1148.9 spec/cli/encrypt_file_spec.rb
travis-1.8.13.travis.1141.9 spec/cli/encrypt_file_spec.rb
travis-1.8.12.travis.1136.9 spec/cli/encrypt_file_spec.rb
travis-1.8.12.travis.1135.9 spec/cli/encrypt_file_spec.rb