Sha256: 6b0877c5f81ae0b613df7e69d8f50b2414fff9423dd6eb29048e8074575e5c4a

Contents?: true

Size: 1.56 KB

Versions: 3

Compression:

Stored size: 1.56 KB

Contents

# -*- coding: utf-8 -*-
# vim:ft=ruby:enc=utf-8

require File.dirname(__FILE__)+'/helper'

class TestCli < Test::Unit::TestCase
  test_presence ToPass::Cli

  def test_cli_usage_without_algorithm
    assert_nothing_raised do
      assert_equal "t35t", `bin/to_pass test`.chomp
    end
  end

  def test_cli_usage_with_password_of
    assert_nothing_raised do
      assert_equal "t35t", `bin/password_of test`.chomp
    end
  end

  def test_cli_usage_with_algorithm
    assert_nothing_raised do
      assert_equal "ti1p4u2", `bin/to_pass 'there is one problem for us, too' -a basic_en`.chomp
    end
  end

  def test_cli_usage_with_pipes
    assert_nothing_raised do
      assert_equal 't35t', `echo "test" | bin/to_pass`
    end
  end

  def test_cli_usage_with_pipe_input
    assert_nothing_raised do
      assert_equal 't35t', `echo "test" | bin/to_pass --no-pipe`.chomp
    end
  end

  def test_cli_usage_with_pipe_output
    assert_nothing_raised do
      assert_equal 't35t', `bin/to_pass test --pipe`
    end
  end


  def test_cli_usage_with_user_algorithm
    with_algorithm_in_user_dir do
      assert_equal "le1/2%z", `bin/to_pass 'leasbpc' -a user_alg`.chomp
      assert_equal "le1/2%z", `bin/to_pass 'luke eats all sausagages because peter cries' -a user_alg`.chomp
    end
  end

  def test_cli_usage_with_pipes_and_user_algorithm
    with_algorithm_in_user_dir do
      assert_equal "le1/2%z", `echo 'leasbpc' | bin/to_pass -a user_alg`.chomp
      assert_equal "le1/2%z", `echo 'luke eats all sausagages because peter cries' | bin/to_pass -a user_alg`.chomp
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
to_pass-0.6.0 test/test_cli.rb
to_pass-0.5.2 test/test_cli.rb
to_pass-0.5.0 test/test_cli.rb