Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- ignore some spaces in string_to_userdata
  • Loading branch information
aschnell committed May 11, 2015
1 parent a873142 commit 21f8b5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/Snapper.rb
Expand Up @@ -482,7 +482,7 @@ def string_to_userdata(string)
tmp1 = string.split(",")

tmp2 = tmp1.map do |s|
s.split("=", 2)
s.split("=", 2).map { |t| t.strip }
end

# TODO, check for = sign, trim
Expand Down
7 changes: 7 additions & 0 deletions test/snapper_string_to_userdata.rb
Expand Up @@ -31,4 +31,11 @@
end


it "call with complex string and space after comma" do

expect(Yast::Snapper.string_to_userdata("a=1, b=2")).to eq({ "a" => "1", "b" => "2" })

end


end

0 comments on commit 21f8b5e

Please sign in to comment.