Sha256: 49db6c1305186a08c30277cb0145b69faaa6235094a6541a2e835be92f967406

Contents?: true

Size: 952 Bytes

Versions: 23

Compression:

Stored size: 952 Bytes

Contents

$VERBOSE = true
require 'test/unit'

require File.expand_path("#{File.dirname(__FILE__)}/../lib/netrc")

class TestParse < Test::Unit::TestCase
  def test_parse_empty
    pre, items = Netrc.parse([])
    assert_equal("", pre)
    assert_equal([], items)
  end

  def test_parse_comment
    pre, items = Netrc.parse(["# foo\n"])
    assert_equal("# foo\n", pre)
    assert_equal([], items)
  end

  def test_parse_item
    t = ["machine", " ", "m", " ", "login", " ", "l", " ", "password", " ", "p", "\n"]
    pre, items = Netrc.parse(t)
    assert_equal("", pre)
    e = [["machine ", "m", " login ", "l", " password ", "p", "\n"]]
    assert_equal(e, items)
  end

  def test_parse_two_items
    t = ["machine", " ", "m", " ", "login", " ", "l", " ", "password", " ", "p", "\n"] * 2
    pre, items = Netrc.parse(t)
    assert_equal("", pre)
    e = [["machine ", "m", " login ", "l", " password ", "p", "\n"]] * 2
    assert_equal(e, items)
  end
end

Version data entries

23 entries across 23 versions & 4 rubygems

Version Path
suzuko-0.1.8 vendor/bundle/ruby/2.0.0/gems/netrc-0.10.3/test/test_parse.rb
suzuko-0.1.7 vendor/bundle/ruby/2.0.0/gems/netrc-0.10.3/test/test_parse.rb
mastermind_adeybee-0.1.4 vendor/bundle/ruby/2.2.0/gems/netrc-0.10.3/test/test_parse.rb
mastermind_adeybee-0.1.3 vendor/bundle/ruby/2.2.0/gems/netrc-0.10.3/test/test_parse.rb
mastermind_adeybee-0.1.2 vendor/bundle/ruby/2.2.0/gems/netrc-0.10.3/test/test_parse.rb
mastermind_adeybee-0.1.1 vendor/bundle/ruby/2.2.0/gems/netrc-0.10.3/test/test_parse.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/netrc-0.10.3/test/test_parse.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/netrc-0.10.3/test/test_parse.rb
netrc-0.10.3 test/test_parse.rb
netrc-0.10.2 test/test_parse.rb
netrc-0.10.1 test/test_parse.rb
netrc-0.10.0 test/test_parse.rb
netrc-0.9.0 test/test_parse.rb
netrc-0.8.0 test/test_parse.rb
netrc-0.7.9 test/test_parse.rb
netrc-0.7.8 test/test_parse.rb
netrc-0.7.7 test/test_parse.rb
netrc-0.7.6 test/test_parse.rb
netrc-0.7.5 test/test_parse.rb
netrc-0.7.4 test/test_parse.rb