Sha256: e152e3b436eae03072dd79fc13918c6a29ff25387a2aa6b2ade7ee243a542b8d

Contents?: true

Size: 1.25 KB

Versions: 206

Compression:

Stored size: 1.25 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').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

206 entries across 206 versions & 1 rubygems

Version Path
travis-1.5.6.travis.336.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.333.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.332.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.330.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.329.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.326.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.324.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.323.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.320.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.319.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.317.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.315.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.314.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.312.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.307.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.306.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.304.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.303.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.301.4 spec/cli/encrypt_spec.rb
travis-1.5.6.travis.299.4 spec/cli/encrypt_spec.rb