diff --git a/lib/flatito/yaml_with_line_number.rb b/lib/flatito/yaml_with_line_number.rb index e70fbd3..2c0e90b 100644 --- a/lib/flatito/yaml_with_line_number.rb +++ b/lib/flatito/yaml_with_line_number.rb @@ -30,8 +30,6 @@ def respond_to_missing?(*) class ClassLoader < Psych::ClassLoader def find(klassname) - @cache[klassname] ||= resolve(klassname) - rescue ArgumentError Whatever.new(klassname) end end diff --git a/test/fixtures/with_ruby_objects.yml b/test/fixtures/with_ruby_objects.yml index b52c464..d667799 100644 --- a/test/fixtures/with_ruby_objects.yml +++ b/test/fixtures/with_ruby_objects.yml @@ -3,6 +3,6 @@ two: !ruby/object:OpenStruct table: one: One two: Two -three: !ruby/object:UnknowClass +three: !ruby/object:UnknownClass one: One two: Two diff --git a/test/flatito/flatten_yaml_test.rb b/test/flatito/flatten_yaml_test.rb index fba5791..d559775 100644 --- a/test/flatito/flatten_yaml_test.rb +++ b/test/flatito/flatten_yaml_test.rb @@ -74,6 +74,10 @@ class Flatito::FlattenYamlTest < Minitest::Test assert_equal "two", items[1].key assert_equal "[object: OpenStruct]", items[1].value assert_equal 2, items[1].line + + assert_equal "three", items[2].key + assert_equal "[object: UnknownClass]", items[2].value + assert_equal 3, items[2].line end test "items from content with duplicated keys" do