Sha256: 2879cb59aae534cbe8e5c2cd25f9c95b59f4e55973d9f2870d8422245033b7c4

Contents?: true

Size: 562 Bytes

Versions: 90

Compression:

Stored size: 562 Bytes

Contents

require 'exercise_cases'

class DominoesCase < OpenStruct
  def test_name
    'test_%s' % description.gsub("can't", 'can not').gsub(/[= -]+/, '_')
  end

  def workload
    <<-WL.chomp
input_dominoes = #{input}
    output_chain = Dominoes.chain(input_dominoes)
    #{can_chain ? 'assert' : 'refute' }_correct_chain(input_dominoes, output_chain)
    WL
  end

  def skipped
    index.zero? ? '# skip' : 'skip'
  end
end

DominoesCases = proc do |data|
  JSON.parse(data)['cases'].map.with_index do |row, i|
    DominoesCase.new(row.merge('index' => i))
  end
end

Version data entries

90 entries across 90 versions & 1 rubygems

Version Path
trackler-2.0.6.41 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.40 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.39 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.38 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.37 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.36 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.35 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.34 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.33 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.32 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.31 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.30 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.29 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.28 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.27 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.26 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.25 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.24 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.23 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.6.22 tracks/ruby/lib/dominoes_cases.rb