summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-28 03:52:15 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-28 03:52:15 +0000
commit4439d294f9c92233a0e213b1c410ab37bb685965 (patch)
tree0a6ad578e5358646b272909869dc0d1ba140eb1d /test
parent3149797a99a79ccba149bc0fe89d57759ede4022 (diff)
downloadruby-4439d294f9c92233a0e213b1c410ab37bb685965.tar.gz
ruby-4439d294f9c92233a0e213b1c410ab37bb685965.tar.xz
ruby-4439d294f9c92233a0e213b1c410ab37bb685965.zip
* test/csv/test_csv.rb: generate bom.csv and mac.csv files on the fly.
[ruby-talk:88852] * test/csv/{bom.csv,mac.csv}: removed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/csv/bom.csv2
-rw-r--r--test/csv/mac.csv2
-rw-r--r--test/csv/test_csv.rb12
3 files changed, 10 insertions, 6 deletions
diff --git a/test/csv/bom.csv b/test/csv/bom.csv
deleted file mode 100644
index 47ab7a601..000000000
--- a/test/csv/bom.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-"foo"
-"bar"
diff --git a/test/csv/mac.csv b/test/csv/mac.csv
deleted file mode 100644
index 95b1a1725..000000000
--- a/test/csv/mac.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-"Avenches","aus Umgebung"
-"Bad Hersfeld","Ausgrabung" \ No newline at end of file
diff --git a/test/csv/test_csv.rb b/test/csv/test_csv.rb
index 6cc4c5cac..709247091 100644
--- a/test/csv/test_csv.rb
+++ b/test/csv/test_csv.rb
@@ -275,8 +275,8 @@ public
@infiletsv = File.join(@tmpdir, 'in.tsv')
@emptyfile = File.join(@tmpdir, 'empty.csv')
@outfile = File.join(@tmpdir, 'out.csv')
- @bomfile = File.join(File.dirname(__FILE__), "bom.csv")
- @macfile = File.join(File.dirname(__FILE__), "mac.csv")
+ @bomfile = File.join(@tmpdir, "bom.csv")
+ @macfile = File.join(@tmpdir, "mac.csv")
CSV.open(@infile, "w") do |writer|
@@fullCSVDataArray.each do |row|
@@ -293,6 +293,14 @@ public
CSV.generate(@emptyfile) do |writer|
# Create empty file.
end
+
+ File.open(@bomfile, "wb") do |f|
+ f.write("\357\273\277\"foo\"\r\n\"bar\"\r\n")
+ end
+
+ File.open(@macfile, "wb") do |f|
+ f.write("\"Avenches\",\"aus Umgebung\"\r\"Bad Hersfeld\",\"Ausgrabung\"")
+ end
end
def teardown