describe CDM::FileWriter do OUTPUT_PATH = "./resources/model_definition.xcdatamodeld/model_definition.xcdatamodel/contents" context "test sample 1" do before :each do class ModelDefinition < CDM::EntityDefinition def define_model create_entity :foo do |e| e.string :foo_string e.date :foo_date e.int16 :foo_int end end end subject.create_model_definition @result = File.open(OUTPUT_PATH, "r") { |f| f.read }.split("\n") end after :all do File.unlink(OUTPUT_PATH) end it "defines the 'foo' entity" do @result[2].should eq ' ' end it "defines the 'foo_string' attribute" do @result[3].should eq ' ' end it "defines the 'foo_date' attribute" do @result[4].should eq ' ' end it "defines the 'foo_int' attribute" do @result[5].should eq ' ' end it "closes the 'foo_entity' definition" do @result[6].should eq ' ' end end end