Sha256: 1cb09b749adfa890169045de29d766c1cfb4b17047ba41bffa8a16708701b2be

Contents?: true

Size: 536 Bytes

Versions: 48

Compression:

Stored size: 536 Bytes

Contents

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

48 entries across 48 versions & 1 rubygems

Version Path
trackler-2.0.3.1 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.3.0 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.2.0 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.1.2 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.1.1 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.1.0 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.0.10 tracks/ruby/lib/dominoes_cases.rb
trackler-2.0.0.9 tracks/ruby/lib/dominoes_cases.rb