diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/exporters/chouette/kml/exporter_spec.rb | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/spec/exporters/chouette/kml/exporter_spec.rb b/spec/exporters/chouette/kml/exporter_spec.rb index dd7c44327..a1d33613d 100644 --- a/spec/exporters/chouette/kml/exporter_spec.rb +++ b/spec/exporters/chouette/kml/exporter_spec.rb @@ -19,37 +19,40 @@ describe Chouette::Kml::Exporter do let!(:line) { Factory(:line_with_stop_areas_having_parent) } let!(:line2) { Factory(:line_with_stop_areas_having_parent) } - describe "#export" do - before(:each) do + describe "#export" do + before(:each) do Dir.mkdir( tmp_path) unless File.directory?( tmp_path) Dir.mkdir( exports_path) unless File.directory?( exports_path) end it "should return a zip file with nothing inside with no objects in arguments" do - subject.export(zip_file_path, {:export_id => 1, :o => "line"} ) + subject.export(zip_file_path, {:export_id => 1, :o => "line"} ) File.exists?(zip_file_path).should be_true + ::Zip::ZipFile.open(zip_file_path) do |f| + puts "f = #{f.inspect}" + end ::Zip::ZipFile.open(zip_file_path).size.should == 6 end it "should return a zip file with 4 kml files" do - subject.export(zip_file_path, {:export_id => 1, :o => "line", :id => "#{line.id}" } ) + subject.export(zip_file_path, {:export_id => 1, :o => "line", :id => "#{line.id}" } ) File.exists?(zip_file_path).should be_true ::Zip::ZipFile.open(zip_file_path).size.should == 4 end it "should return a zip file with 6 kml files" do - subject.export(zip_file_path, {:export_id => 1, :o => "line", :id => "#{line.id},#{line2.id}" } ) + subject.export(zip_file_path, {:export_id => 1, :o => "line", :id => "#{line.id},#{line2.id}" } ) File.exists?(zip_file_path).should be_true ::Zip::ZipFile.open(zip_file_path).size.should == 6 end it "should return a zip file with 6 kml files" do - subject.export(zip_file_path, {:export_id => 1, :o => "", :id => "" } ) + subject.export(zip_file_path, {:export_id => 1, :o => "", :id => "" } ) File.exists?(zip_file_path).should be_true ::Zip::ZipFile.open(zip_file_path).size.should == 6 end - - end - + + end + end |
