elsif (hash[:line] =~ /^\s*(Defaults\S*)\s*(.*)$/)
Puppet.debug("parsed line as Defaults")
parsed.parse_defaults($1, $2, hash)
- elsif (hash[:line] =~ /^\s*(.*)?=(.*)$/)
+ elsif (hash[:line] =~ /^\s*(.*?)?=(.*)$/)
Puppet.debug("parsed line as User Spec")
parsed.parse_user_spec($1, $2, hash)
else
# test to_line
end
+
+ context "failing for commands containing =",:issue => 1 do
+ before do
+ @init_records = {:type => 'user_spec'}
+ end
+
+ it "can parse users and hosts for lines containing =" do
+ line = "root ALL=(ALL) NOPASSWD: /bin/grep --color=auto example /var/log/messages"
+ lambda{
+ @provider.parse_line(line)
+ }.should_not raise_error
+ end
+ end
end