From dddfa903d2b856146f05ffb4415c31d6127bb5bf Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Mon, 14 Jan 2019 01:40:56 -0500 Subject: New upstream version 2.8.0 --- test/excelx/test_coordinate.rb | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 test/excelx/test_coordinate.rb (limited to 'test/excelx/test_coordinate.rb') diff --git a/test/excelx/test_coordinate.rb b/test/excelx/test_coordinate.rb new file mode 100644 index 0000000..5cddcc4 --- /dev/null +++ b/test/excelx/test_coordinate.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +require "test_helper" + +class TestRooExcelxCoordinate < Minitest::Test + def row + 10 + end + + def column + 20 + end + + def coordinate + Roo::Excelx::Coordinate.new(row, column) + end + + def array + [row, column] + end + + def test_row + assert_same row, coordinate.row + end + + def test_column + assert_same column, coordinate.column + end + + def test_frozen? + assert coordinate.frozen? + end + + def test_equality + hash = {} + hash[coordinate] = true + assert hash.key?(coordinate) + assert hash.key?(array) + end + + def test_expand + r, c = coordinate + assert_same row, r + assert_same column, c + end + + def test_aref + assert_same row, coordinate[0] + assert_same column, coordinate[1] + end +end -- cgit v1.2.3