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.2.1.72 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.71 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.70 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.69 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.68 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.67 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.66 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.65 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.64 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.63 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.62 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.61 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.60 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.59 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.58 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.57 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.56 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.55 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.54 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.53 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb