| Module | YamlExtension::Assertions |
| In: |
lib/yaml_extension.rb
|
| ref | [RW] | @val is here to receive the result of YAML::load, @str receives the result of X.to_yaml, @ref is the reference string |
| str | [RW] | @val is here to receive the result of YAML::load, @str receives the result of X.to_yaml, @ref is the reference string |
| val | [RW] | @val is here to receive the result of YAML::load, @str receives the result of X.to_yaml, @ref is the reference string |
# File lib/yaml_extension.rb, line 84 def assert_yaml_dump ( anObject, ref, options={} ) assert_nothing_raised { @str = anObject.to_yaml(options) } @str.gsub!(/---\s*/, '') @str.chomp! if ref.is_a? Regexp assert_match(ref, @str) else assert_equal(ref, @str) end end