diff options
Diffstat (limited to 'spec/ruby/library/yaml/fixtures')
-rw-r--r-- | spec/ruby/library/yaml/fixtures/common.rb | 10 | ||||
-rw-r--r-- | spec/ruby/library/yaml/fixtures/example_class.rb | 5 | ||||
-rw-r--r-- | spec/ruby/library/yaml/fixtures/strings.rb | 36 | ||||
-rw-r--r-- | spec/ruby/library/yaml/fixtures/test_yaml.yml | 2 |
4 files changed, 53 insertions, 0 deletions
diff --git a/spec/ruby/library/yaml/fixtures/common.rb b/spec/ruby/library/yaml/fixtures/common.rb new file mode 100644 index 0000000000..1d868806f1 --- /dev/null +++ b/spec/ruby/library/yaml/fixtures/common.rb @@ -0,0 +1,10 @@ +begin + require 'syck' +rescue LoadError + # do nothing +end + +require 'yaml' + +$test_file = tmp("yaml_test_file") +$test_parse_file = File.dirname(__FILE__) + "/test_yaml.yml" diff --git a/spec/ruby/library/yaml/fixtures/example_class.rb b/spec/ruby/library/yaml/fixtures/example_class.rb new file mode 100644 index 0000000000..751435a305 --- /dev/null +++ b/spec/ruby/library/yaml/fixtures/example_class.rb @@ -0,0 +1,5 @@ +class FooBar + def initialize(name) + @name = name + end +end diff --git a/spec/ruby/library/yaml/fixtures/strings.rb b/spec/ruby/library/yaml/fixtures/strings.rb new file mode 100644 index 0000000000..6f66dc3659 --- /dev/null +++ b/spec/ruby/library/yaml/fixtures/strings.rb @@ -0,0 +1,36 @@ +$complex_key_1 = <<EOY + ? # PLAY SCHEDULE + - Detroit Tigers + - Chicago Cubs + : + - 2001-07-23 + + ? [ New York Yankees, + Atlanta Braves ] + : [ 2001-07-02, 2001-08-12, + 2001-08-14 ] +EOY + +$to_yaml_hash = +<<EOY +- + avg: 0.278 + hr: 65 + name: Mark McGwire +- + avg: 0.288 + hr: 63 + name: Sammy Sosa +EOY + +$multidocument = <<EOY +--- +- Mark McGwire +- Sammy Sosa +- Ken Griffey + +# Team ranking +--- +- Chicago Cubs +- St Louis Cardinals +EOY diff --git a/spec/ruby/library/yaml/fixtures/test_yaml.yml b/spec/ruby/library/yaml/fixtures/test_yaml.yml new file mode 100644 index 0000000000..efe3b5cc1a --- /dev/null +++ b/spec/ruby/library/yaml/fixtures/test_yaml.yml @@ -0,0 +1,2 @@ +project: + name: RubySpec |