summaryrefslogtreecommitdiff
path: root/spec/ruby/library/csv/generate_line_spec.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2024-01-22 17:23:33 +0900
committerHiroshi SHIBATA <[email protected]>2024-01-22 18:23:05 +0900
commitf2dce4e6e07abf632357ac105f4ed201e4ee9781 (patch)
treebf3d6b76a1f4055b2195db1fcec89160ff0b0d42 /spec/ruby/library/csv/generate_line_spec.rb
parente195710d10225458008b79dbb734b1cddcd6230d (diff)
spec/mspec/tool/wrap_with_guard.rb 'ruby_version_is ""..."3.4"' spec/ruby/library/csv/**/*.rb
Diffstat (limited to 'spec/ruby/library/csv/generate_line_spec.rb')
-rw-r--r--spec/ruby/library/csv/generate_line_spec.rb45
1 files changed, 24 insertions, 21 deletions
diff --git a/spec/ruby/library/csv/generate_line_spec.rb b/spec/ruby/library/csv/generate_line_spec.rb
index 656365b109..0830bbdb63 100644
--- a/spec/ruby/library/csv/generate_line_spec.rb
+++ b/spec/ruby/library/csv/generate_line_spec.rb
@@ -1,30 +1,33 @@
require_relative '../../spec_helper'
-require 'csv'
-describe "CSV.generate_line" do
+ruby_version_is ""..."3.4" do
+ require 'csv'
- it "generates an empty string" do
- result = CSV.generate_line([])
- result.should == "\n"
- end
+ describe "CSV.generate_line" do
- it "generates the string 'foo,bar'" do
- result = CSV.generate_line(["foo", "bar"])
- result.should == "foo,bar\n"
- end
+ it "generates an empty string" do
+ result = CSV.generate_line([])
+ result.should == "\n"
+ end
- it "generates the string 'foo;bar'" do
- result = CSV.generate_line(["foo", "bar"], col_sep: ?;)
- result.should == "foo;bar\n"
- end
+ it "generates the string 'foo,bar'" do
+ result = CSV.generate_line(["foo", "bar"])
+ result.should == "foo,bar\n"
+ end
- it "generates the string 'foo,,bar'" do
- result = CSV.generate_line(["foo", nil, "bar"])
- result.should == "foo,,bar\n"
- end
+ it "generates the string 'foo;bar'" do
+ result = CSV.generate_line(["foo", "bar"], col_sep: ?;)
+ result.should == "foo;bar\n"
+ end
+
+ it "generates the string 'foo,,bar'" do
+ result = CSV.generate_line(["foo", nil, "bar"])
+ result.should == "foo,,bar\n"
+ end
- it "generates the string 'foo;;bar'" do
- result = CSV.generate_line(["foo", nil, "bar"], col_sep: ?;)
- result.should == "foo;;bar\n"
+ it "generates the string 'foo;;bar'" do
+ result = CSV.generate_line(["foo", nil, "bar"], col_sep: ?;)
+ result.should == "foo;;bar\n"
+ end
end
end