Sha256: d958aa3eff29673e99d5f838301836a86e34227f4d34c7e6bd921e6358cc9984

Contents?: true

Size: 361 Bytes

Versions: 159

Compression:

Stored size: 361 Bytes

Contents

require 'generator/exercise_case'

class HammingCase < Generator::ExerciseCase
  def workload
    if expects_error?
      assert_raises(ArgumentError) { test_case }
    else
      assert_equal { test_case }
    end
  end

  private

  def test_case
    "Hamming.compute('#{strand1}', '#{strand2}')"
  end

  def expects_error?
    expected.is_a? Hash
  end
end

Version data entries

159 entries across 159 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.118 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.117 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.116 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.115 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.114 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.113 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.111 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.110 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.109 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.108 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.107 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.106 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.105 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.104 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.103 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.102 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.101 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.100 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb
trackler-2.2.1.99 tracks/ruby/exercises/hamming/.meta/generator/hamming_case.rb