Sha256: fadbd37c8ab46da97390e3647760d04db7bb617418e7be7d46e9d4f4061c5eb1

Contents?: true

Size: 1.56 KB

Versions: 91

Compression:

Stored size: 1.56 KB

Contents

require 'spec_helper'

describe Travis::CLI::Encrypt do
  example "travis encrypt foo" do
    run_cli('encrypt', 'foo').should be_success
    stdout.should match(/^".{60,}"\n$/)
  end

  example "travis encrypt foo -r rails/rails" do
    run_cli('encrypt', 'foo', '-r', 'rails/rails').should be_success
    stdout.should match(/^".{60,}"\n$/)
  end

  example "travis encrypt foo -i" do
    run_cli('encrypt', 'foo', '-i', '--skip-completion-check', '-r', 'travis-ci/travis.rb').should be_success
    stdout.should start_with("Please add the following to your .travis.yml file:\n\n  secure: ")
  end

  example "cat foo | travis encrypt" do
    run_cli('encrypt') { |i| i.puts('foo') }
    stdout.should match(/\A".{60,}"\n\Z/)
  end

  example "cat foo\\nbar | travis encrypt -s" do
    run_cli('encrypt', '-s') { |i| i.puts("foo\nbar") }
    stdout.should match(/\A(".{60,}"\n){2}\Z/)
  end

  example "cat foo\\nbar | travis encrypt" do
    run_cli('encrypt') { |i| i.puts("foo\nbar") }
    stdout.should match(/\A".{60,}"\n\Z/)
  end

  example "travis encrypt rails/rails foo" do
    run_cli('encrypt', 'rails/rails', 'foo').should be_success
    stderr.should match(/WARNING/)
  end

  example "travis encrypt foo=foo/bar" do
    run_cli("encrypt", "foo=foo/bar").should be_success
    stderr.should_not match(/WARNING/)
  end

  example "travis encrypt FOO bar -a" do
    described_class.any_instance.stub(:save_travis_config)
    run_cli("encrypt", "FOO", "bar", "-a").should be_success
    stderr.should match(/Environment variables in env\.global should be formatted as FOO=bar/)
  end
end

Version data entries

91 entries across 91 versions & 2 rubygems

Version Path
travis-1.8.12.travis.1125.9 spec/cli/encrypt_spec.rb
travis-1.8.12.pre.rc1 spec/cli/encrypt_spec.rb
travis-1.8.12.travis.1116.9 spec/cli/encrypt_spec.rb
travis-1.8.12.travis.1111.9 spec/cli/encrypt_spec.rb
travis-1.8.12.travis.1101.9 spec/cli/encrypt_spec.rb
travis-1.8.11 spec/cli/encrypt_spec.rb
travis-1.8.11.travis.1098.9 spec/cli/encrypt_spec.rb
travis-1.8.11.travis.1081.9 spec/cli/encrypt_spec.rb
travis-1.8.11.travis.1059.11 spec/cli/encrypt_spec.rb
travis-1.8.11.travis.1058.11 spec/cli/encrypt_spec.rb
travis-1.8.11.travis.1056.11 spec/cli/encrypt_spec.rb
travis-1.8.11.travis.1051.11 spec/cli/encrypt_spec.rb
travis-1.8.11.travis.1048.11 spec/cli/encrypt_spec.rb
travis-1.8.11.travis.1044.11 spec/cli/encrypt_spec.rb
travis-1.8.11.travis.1041.11 spec/cli/encrypt_spec.rb
travis-1.8.11.travis.1040.11 spec/cli/encrypt_spec.rb
travis-1.8.11.travis.1026.11 spec/cli/encrypt_spec.rb
travis-1.8.11.travis.1025.11 spec/cli/encrypt_spec.rb
travis-1.8.11.travis.1024.11 spec/cli/encrypt_spec.rb
travis-1.8.11.travis.1022.11 spec/cli/encrypt_spec.rb