Sha256: 8d704951fe469611057c92687be468c147b82fe39f2a8975aa458d9e9c5bd3c9
Contents?: true
Size: 617 Bytes
Versions: 1
Compression:
Stored size: 617 Bytes
Contents
describe "Conversion to YAML" do # check each model to see if the conversion *.to_yaml works. Dir[File.dirname(__FILE__) + "/fixtures/*.yaml"].each do |path| name = File::basename(path).sub(/\.yaml$/, '') klass = Kernel::const_get(Inflector.classify(Inflector.singularize(name))) it "the first #{klass} converted to YAML should match the YAML in the fixture" do YAML::load(klass.first.to_yaml).to_a.reject do |pair| pair.first == "updated_at" || pair.first == "id" end.sort.should == YAML::load_file("./spec/fixtures/#{name}.yaml")[0].to_a.sort end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
datamapper-0.2.0 | spec/conversions_to_yaml_spec.rb |