diff --git a/lib/rx-file.rb b/lib/rx-file.rb index 23ebbf8..a52ea21 100644 --- a/lib/rx-file.rb +++ b/lib/rx-file.rb @@ -13,6 +13,11 @@ require_relative "rx-file/array_node" require_relative "rx-file/hash_node" require_relative "rx-file/occurence" +Object.class_eval do + def to_rxf + RxFile.write(self) + end +end Class.class_eval do def to_rxf self.name diff --git a/test/helper.rb b/test/helper.rb index 5454f66..a269bbf 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -13,7 +13,7 @@ require 'rx-file' module Checker def check should - out = RxFile.write(@out) + out = @out.to_rxf same = (should == out) puts "Shouldda\n#{out}" unless same assert_equal should , out