Sha256: 2eefecaade3de66af0e5f153244ce3405530262942c009c2265a6589a203697e

Contents?: true

Size: 448 Bytes

Versions: 105

Compression:

Stored size: 448 Bytes

Contents

require 'generator/exercise_case'

class IsogramCase < Generator::ExerciseCase

  def workload
    indent_lines(
      [
        "string = #{input.inspect}",
        "#{assert} Isogram.isogram?(string), #{failure_message}"
      ], 4
    )
  end

  private

  def failure_message
    %Q("Expected #{expected}, #{reason}")
  end

  def reason
    "'#{input}' #{is_or_not} an isogram"
  end

  def is_or_not
    expected ? 'is' : 'is not'
  end

end

Version data entries

105 entries across 105 versions & 1 rubygems

Version Path
trackler-2.1.0.34 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.1.0.33 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.1.0.32 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.1.0.31 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.1.0.30 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb