Sha256: 1b8c2cee79b5f8b9504bc23acb9e4c9c0cf214a41812db74c6e8f4b0ee7a9ff1

Contents?: true

Size: 1.31 KB

Versions: 34

Compression:

Stored size: 1.31 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
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
travis-async-listener-1.8.3 spec/cli/encrypt_spec.rb
travis-1.8.3.travis.745.4 spec/cli/encrypt_spec.rb
travis-1.8.3.travis.726.4.pre.debug spec/cli/encrypt_spec.rb
travis-1.8.3.travis.724.4 spec/cli/encrypt_spec.rb
travis-1.8.2 spec/cli/encrypt_spec.rb
travis-1.8.2.travis.722.4 spec/cli/encrypt_spec.rb
travis-1.8.2.travis.719.4 spec/cli/encrypt_spec.rb
travis-1.8.1 spec/cli/encrypt_spec.rb
travis-1.8.1.travis.717.4 spec/cli/encrypt_spec.rb
travis-1.8.1.travis.713.4 spec/cli/encrypt_spec.rb
travis-1.8.1.travis.705.5 spec/cli/encrypt_spec.rb
travis-1.8.1.travis.704.5 spec/cli/encrypt_spec.rb
travis-1.8.1.travis.699.5 spec/cli/encrypt_spec.rb
travis-1.8.1.travis.697.5 spec/cli/encrypt_spec.rb
travis-1.8.1.travis.696.5 spec/cli/encrypt_spec.rb
travis-1.8.1.travis.693.5 spec/cli/encrypt_spec.rb
travis-1.8.1.travis.692.5 spec/cli/encrypt_spec.rb
travis-1.8.1.travis.689.5 spec/cli/encrypt_spec.rb
travis-1.8.0 spec/cli/encrypt_spec.rb
travis-1.7.8.travis.688.5 spec/cli/encrypt_spec.rb