Sha256: f55edd02aff49711c47890a9120e175b49e74e53c3fc243bab5e39c27398aba3

Contents?: true

Size: 718 Bytes

Versions: 67

Compression:

Stored size: 718 Bytes

Contents

class TwoBucketCase < OpenStruct
  def test_name
    "test_bucket_one_#{bucket_one}_bucket_two_"\
    "#{bucket_two}_goal_#{goal}_starting_#{start_bucket}"
  end

  def do
    "TwoBucket.new(#{bucket_one}, #{bucket_two}, #{goal}, '#{start_bucket}')"
  end

  def test_body
    "two_bucket = #{self.do}
    assert_equal #{expected['moves']}, two_bucket.moves
    assert_equal '#{expected['goal_bucket']}', two_bucket.goal_bucket
    assert_equal #{expected['other_bucket']}, two_bucket.other_bucket"
  end

  def skipped?
    index > 0
  end
end

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

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
trackler-2.0.6.11 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.6.10 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.6.9 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.6.8 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.6.7 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.6.6 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.6.5 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.6.4 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.6.3 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.6.2 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.6.1 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.6.0 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.5.18 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.5.17 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.5.16 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.5.15 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.5.14 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.5.13 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.5.12 tracks/ruby/lib/two_bucket_cases.rb
trackler-2.0.5.11 tracks/ruby/lib/two_bucket_cases.rb