Sha256: 7d9468a678979c4eefb4431e3811bce650e40f49385160b9048d684d1fca82df

Contents?: true

Size: 622 Bytes

Versions: 5

Compression:

Stored size: 622 Bytes

Contents

require 'facets/shellwords'
require 'test/unit'

class TestShellwords < Test::Unit::TestCase

  def test_array_shellwords_1
    e = ["a", "b"]
    a = ["a", "b"].shellwords
    assert_equal(e, a)
  end

  def test_array_shellwords_2
    e = ["-d", "a", "b"]
    a = ["a", "b", {:d=>true}].shellwords
    assert_equal(e, a)
  end

  def test_hash_shellwords_1
    e = ['--debug']
    a = {:debug=>true}.shellwords
    assert_equal(e, a)
  end

  def test_hash_shellwords_2
    e = ['--name="jim"', '--debug']
    a = {:debug=>true, :name=>"jim"}.shellwords
    a.each do |x|
      assert(e.include?(x))
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
facets-2.8.4 test/more/test_shellwords.rb
facets-2.8.3 test/more/test_shellwords.rb
facets-2.8.2 test/more/test_shellwords.rb
facets-2.8.1 test/more/test_shellwords.rb
facets-2.8.0 test/more/test_shellwords.rb