Sha256: 18ae59279b6e4567bf5177d456494ba2cff562a26114c66d4e5d120f5e8d3713

Contents?: true

Size: 696 Bytes

Versions: 8

Compression:

Stored size: 696 Bytes

Contents

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

describe ContentParser do
  let (:parser) { Class.new() { include ContentParser }.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 = [{
        "name"=>"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

8 entries across 8 versions & 1 rubygems

Version Path
inspec-0.9.7 test/unit/utils/content_parser_test.rb
inspec-0.9.6 test/unit/utils/content_parser_test.rb
inspec-0.9.5 test/unit/utils/content_parser_test.rb
inspec-0.9.4 test/unit/utils/content_parser_test.rb
inspec-0.9.3 test/unit/utils/content_parser_test.rb
inspec-0.9.2 test/unit/utils/content_parser_test.rb
inspec-0.9.1 test/unit/utils/content_parser_test.rb
inspec-0.9.0 test/unit/utils/content_parser_test.rb