Sha256: 792f6d53e777e7bc8f8930d09c3cca3a343ff18b154ce6902229dfd43f4498d6

Contents?: true

Size: 712 Bytes

Versions: 42

Compression:

Stored size: 712 Bytes

Contents

# encoding: utf-8
# author: Dominik Richter
# author: Christoph Hartmann

require 'helper'

describe PasswdParser do
  let (:parser) { Class.new() { include PasswdParser }.new }

  describe '#parse_passwd' do
    it 'parses nil content' do
      parser.parse_passwd(nil).must_equal([])
    end

    it 'parses an empty passwd line' do
      parser.parse_passwd('').must_equal([])
    end

    it 'parses a valid passwd line' do
      info = [{
        "user"=>"root",
        "password"=>"x",
        "uid"=>"0",
        "gid"=>"0",
        "desc"=>"root",
        "home"=>"/root",
        "shell"=>"/bin/sh"
      }]
      parser.parse_passwd('root:x:0:0:root:/root:/bin/sh').must_equal(info)
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
inspec-0.30.0 test/unit/utils/passwd_parser_test.rb
inspec-0.29.0 test/unit/utils/passwd_parser_test.rb
inspec-0.28.1 test/unit/utils/passwd_parser_test.rb
inspec-0.28.0 test/unit/utils/passwd_parser_test.rb
inspec-0.27.1 test/unit/utils/passwd_parser_test.rb
inspec-0.27.0 test/unit/utils/passwd_parser_test.rb
inspec-0.26.0 test/unit/utils/passwd_parser_test.rb
inspec-0.25.0 test/unit/utils/passwd_parser_test.rb
inspec-0.24.0 test/unit/utils/passwd_parser_test.rb
inspec-0.23 test/unit/utils/passwd_parser_test.rb
inspec-0.22.1 test/unit/utils/passwd_parser_test.rb
inspec-0.22.0 test/unit/utils/passwd_parser_test.rb
inspec-0.21.6 test/unit/utils/passwd_parser_test.rb
inspec-0.21.5 test/unit/utils/passwd_parser_test.rb
inspec-0.21.4 test/unit/utils/passwd_parser_test.rb
inspec-0.21.3 test/unit/utils/passwd_parser_test.rb
inspec-0.21.2 test/unit/utils/passwd_parser_test.rb
inspec-0.21.1 test/unit/utils/passwd_parser_test.rb
inspec-0.21.0 test/unit/utils/passwd_parser_test.rb
inspec-0.20.1 test/unit/utils/passwd_parser_test.rb