Skip to content

Commit

Permalink
Add test for Yaml serialization of HighLine::String - closes #69
Browse files Browse the repository at this point in the history
This was a YAML related bug (not HighLine one).
Writing this test to protect against regressions.
  • Loading branch information
abinoam committed Feb 4, 2015
1 parent 410d9ec commit 1c6a8fa
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/tc_string_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,16 @@ def setup
end

include StringMethods

def test_Highline_String_is_yaml_serializable
require 'yaml'

highline_string = HighLine::String.new("Yaml didn't messed with HighLine::String")
yaml_highline_string = highline_string.to_yaml
yaml_loaded_string = YAML.load(yaml_highline_string)

assert_equal "Yaml didn't messed with HighLine::String", yaml_loaded_string
assert_equal highline_string, yaml_loaded_string
assert_instance_of HighLine::String, yaml_loaded_string
end
end

0 comments on commit 1c6a8fa

Please sign in to comment.