diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-25 06:49:59 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-25 06:49:59 +0000 |
commit | 24b57b102c1992b679f8f8c0fd1a0239289a129b (patch) | |
tree | e25055dbfcef70d3b01855c004e57e130b3fac5f /test/csv/test_row.rb | |
parent | cdca14e75e98e2657daa40589f18a0ad46846020 (diff) |
Upgrade CSV to 3.0.4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/csv/test_row.rb')
-rwxr-xr-x | test/csv/test_row.rb | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/test/csv/test_row.rb b/test/csv/test_row.rb index 67ed65c0db..f709dd3f13 100755 --- a/test/csv/test_row.rb +++ b/test/csv/test_row.rb @@ -1,14 +1,9 @@ -#!/usr/bin/env ruby -w -# encoding: UTF-8 +# -*- coding: utf-8 -*- # frozen_string_literal: false -# tc_row.rb -# -# Created by James Edward Gray II on 2005-10-31. +require_relative "helper" -require_relative "base" - -class TestCSV::Row < TestCSV +class TestCSVRow < Test::Unit::TestCase extend DifferentOFS def setup @@ -105,6 +100,19 @@ class TestCSV::Row < TestCSV def test_has_key? assert_equal(true, @row.has_key?('B')) assert_equal(false, @row.has_key?('foo')) + + # aliases + assert_equal(true, @row.header?('B')) + assert_equal(false, @row.header?('foo')) + + assert_equal(true, @row.include?('B')) + assert_equal(false, @row.include?('foo')) + + assert_equal(true, @row.member?('B')) + assert_equal(false, @row.member?('foo')) + + assert_equal(true, @row.key?('B')) + assert_equal(false, @row.key?('foo')) end def test_set_field @@ -261,12 +269,6 @@ class TestCSV::Row < TestCSV end def test_queries - # headers - assert_send([@row, :header?, "A"]) - assert_send([@row, :header?, "C"]) - assert_not_send([@row, :header?, "Z"]) - assert_send([@row, :include?, "A"]) # alias - # fields assert(@row.field?(4)) assert(@row.field?(nil)) |