diff --git a/exercises/practice/series/.meta/example.rb b/exercises/practice/series/.meta/example.rb index d93923d611..dfca6db15a 100644 --- a/exercises/practice/series/.meta/example.rb +++ b/exercises/practice/series/.meta/example.rb @@ -1,5 +1,6 @@ class Series def initialize(series) + raise ArgumentError if series.length.zero? @series = series end def slices(n) diff --git a/exercises/practice/series/series_test.rb b/exercises/practice/series/series_test.rb index 759b5c5288..f93e624068 100644 --- a/exercises/practice/series/series_test.rb +++ b/exercises/practice/series/series_test.rb @@ -68,9 +68,8 @@ def test_slice_length_cannot_be_negative def test_empty_series_is_invalid skip slice_string = "" - series = Series.new(slice_string) assert_raises ArgumentError do - series.slices(1) + Series.new(slice_string) end end end