+ assert_equal 1, trace.size
+ end
+
+ def test_import_handles_plain_with_bom
+ trace = create(:trace, :inserted => false, :fixture => "b")
+
+ trace.import
+
+ assert_equal 1, trace.size
+ end
+
+ def test_import_handles_gz
+ trace = create(:trace, :inserted => false, :fixture => "d")
+
+ trace.import
+
+ assert_equal 1, trace.size
+ end
+
+ def test_import_handles_zip
+ trace = create(:trace, :inserted => false, :fixture => "f")
+
+ trace.import
+
+ assert_equal 2, trace.size
+ end
+
+ def test_import_handles_tar
+ trace = create(:trace, :inserted => false, :fixture => "g")
+
+ trace.import
+
+ assert_equal 2, trace.size
+ end
+
+ def test_import_handles_tar_gz
+ trace = create(:trace, :inserted => false, :fixture => "h")
+
+ trace.import
+
+ assert_equal 2, trace.size
+ end
+
+ def test_import_handles_tar_bz2
+ trace = create(:trace, :inserted => false, :fixture => "i")
+
+ trace.import
+
+ assert_equal 2, trace.size
+ end
+
+ def test_import_enforces_limit
+ trace = create(:trace, :inserted => false, :fixture => "f")
+
+ with_settings(:max_trace_size => 1) do
+ assert_raise GPX::FileTooBigError do
+ trace.import
+ end