Sha256: 52446d61287e4f3bcc57bb5c28b868373ff8e39e3e86c660a7b22eba54996558

Contents?: true

Size: 778 Bytes

Versions: 11

Compression:

Stored size: 778 Bytes

Contents

require File.join(File.dirname(__FILE__), "test_cli_helper.rb")
require 'rbkb/cli/b64'

class TestCliB64 < Test::Unit::TestCase
  include CliTest

  def setup
    @cli_class = Rbkb::Cli::B64
    super()
  end

  def test_basic_string_arg
    assert_equal 0, run_with_args(%w(fooby))
    assert_equal "Zm9vYnk=\n", @stdout_io.string
  end

  def test_stdin
    @stdin_io.write("fooby") ; @stdin_io.rewind
    assert_equal 0, run_with_args()
    assert_equal "Zm9vYnk=\n", @stdout_io.string
  end


  def test_length_arg
    assert_equal 0, run_with_args(%w(-l 2 fooby))
    assert_equal "Zm\n9v\nYn\nk=\n", @stdout_io.string
  end

  def test_bad_length_arg
    assert_equal 1, run_with_args(%w(-l -2 fooby))
    assert_match(/length must be > 0/, @stderr_io.string)
  end


end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
emonti-rbkb-0.6.6 test/test_cli_b64.rb
emonti-rbkb-0.6.7 test/test_cli_b64.rb
emonti-rbkb-0.6.8 test/test_cli_b64.rb
emonti-rbkb-0.6.9.1 test/test_cli_b64.rb
emonti-rbkb-0.6.9 test/test_cli_b64.rb
rbkb-0.7.2 test/test_cli_b64.rb
rbkb-0.7.1 test/test_cli_b64.rb
rbkb-0.7.0 test/test_cli_b64.rb
rbkb-0.6.12 test/test_cli_b64.rb
rbkb-0.6.11 test/test_cli_b64.rb
rbkb-0.6.10 test/test_cli_b64.rb