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.32 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.31 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.30 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.29 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.28 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.27 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.26 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.25 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.24 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.23 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.22 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.21 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.20 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.19 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.18 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.17 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.16 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.15 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.14 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb
trackler-2.2.1.13 tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb