def inspect
data = []
if nil != @age
- data.push('age="' + @age.inspect + '"')
+ data.push('age=' + @age.inspect)
end
if nil != @code
- data.push('code="' + @code.inspect + '"')
+ data.push('code=' + @code.inspect)
end
if nil != @descr
data.push('descr="' + @descr + '"')
if nil != @grouping
data.push('grouping="' + @grouping + '"')
end
- return '(Series:' + data.join(',') + ')'
+ return '(Series: ' + data.join(' ') + ')'
end
def key
--- /dev/null
+# frozen_string_literal: true
+
+require "test_helper"
+
+require "series"
+
+class SeriesTest < Minitest::Test
+ def test_inspect
+ age = "ya"
+ genre = "romance"
+ grouping = "LouisaAlcott"
+ code = "LW"
+ descr = "Little Women"
+ id = 1
+
+ series = Series.new(id)
+ series.age = age
+ series.genre = genre
+ series.grouping = grouping
+ series.code = code
+ series.descr = descr
+
+ expected = '(Series: age="ya" code="LW" descr="Little Women" genre="romance" grouping="LouisaAlcott")'
+
+ actual = series.inspect
+
+ assert_equal expected, actual
+ end
+end