Skip to content

Commit

Permalink
Merge sup-heliotrope#16: Fix YAML regression in 1.9
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit a26b99c64e2da4115ea47606ae8b66f0b008b002
Author: Whyme Lyu <[email protected]>
Date:   Tue Mar 26 23:03:50 2013 +0800

    Ensure Syck is used.

    In the long run we'd better drop Syck in favor of Psych

commit a99a2b244063c2088d91688f667ee68f05f24df0
Author: Whyme Lyu <[email protected]>
Date:   Tue Mar 26 23:03:25 2013 +0800

    A regression test for YAMLing in 1.9
  • Loading branch information
5long authored and gauteh committed Apr 20, 2013
1 parent 66e183c commit ac82b28
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 0 additions & 1 deletion bin/sup-config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require 'rubygems'
require 'highline/import'
require 'yaml'
require 'trollop'
require "sup"

Expand Down
3 changes: 3 additions & 0 deletions lib/sup.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require 'rubygems'

require 'syck'
require 'yaml'
YAML::ENGINE.yamler = 'syck'

require 'zlib'
require 'thread'
require 'fileutils'
Expand Down
17 changes: 17 additions & 0 deletions test/test_yaml_regressions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require 'test/unit'

# Requiring 'yaml' before 'sup' in 1.9.x would get Psych loaded first
# and becoming the default yamler.
require 'yaml'
require 'sup'

module Redwood
class TestYamlRegressions < Test::Unit::TestCase
def test_yamling_hash
hsh = {:foo => 42}
reloaded = YAML.load(hsh.to_yaml)

assert_equal reloaded, hsh
end
end
end

0 comments on commit ac82b28

Please sign in to comment.