Sha256: a2bdf11bd871c9b8e6d27a539f0157a92cb727ef12e201921d87c78685a956ba
Contents?: true
Size: 536 Bytes
Versions: 233
Compression:
Stored size: 536 Bytes
Contents
require 'generator/exercise_case' class RunLengthEncodingCase < Generator::ExerciseCase def name super.sub('test_',"test_#{property}_") end def workload indent_lines([ "input = '#{input}'", "output = '#{expected}'", assertion ], 4) end private def assertion if property == 'consistency' 'assert_equal output, RunLengthEncoding.decode(RunLengthEncoding.encode(input))' else "assert_equal output, RunLengthEncoding.#{property}(input)" end end end
Version data entries
233 entries across 233 versions & 1 rubygems