<commit_before>require 'helper'

CASCADE = Catheter::Cascade.new(:my_cascade) do |t|
  t.base do |t, opts|
    t.set_value :item, opts[:item]
    t.set_value :image, "#{opts[:player]}.png"
  end
  
  t.layer name: :contribute_base do |t, opts|
    t.set_value :player, opts[:player]
    t.set_value :image, "#{opts[:item]}.png"
  end
  
  t.layer name: :contribute_part, depends: [:contribute_base] do |t, opts|
    t.set_value :body, t.get_value(:image)
  end
end

OPTS = {:player => "jordanrw", :item => "cool-thing"}

class TestCatheter < MiniTest::Unit::TestCase
  def test_base
    result = CASCADE.build(:base, OPTS)
    
    assert_equal OPTS[:item], result[:item]
    assert_equal "#{OPTS[:player]}.png", result[:image]
  end
  
  def test_one_layer
    result = CASCADE.build(:contribute_base, OPTS)
    
    assert_equal OPTS[:player], result[:player]
    assert_equal "#{OPTS[:item]}.png", result[:image]
  end
  
  def test_two_layers
    result = CASCADE.build(:contribute_part, OPTS)
    
    assert_equal OPTS[:player], result[:player]
    assert_equal OPTS[:item], result[:item]
    assert_equal "#{OPTS[:item]}.png", result[:image]
    assert_equal result[:image], result[:body]
  end
  
  def test_layers_that_depend_on_layers_that_depend_on_layers
    
  end<commit_msg>2 test skeletons I need<commit_after>require 'helper'

CASCADE = Catheter::Cascade.new(:my_cascade) do |t|
  t.base do |t, opts|
    t.set_value :item, opts[:item]
    t.set_value :image, "#{opts[:player]}.png"
  end
  
  t.layer name: :contribute_base do |t, opts|
    t.set_value :player, opts[:player]
    t.set_value :image, "#{opts[:item]}.png"
  end
  
  t.layer name: :contribute_part, depends: [:contribute_base] do |t, opts|
    t.set_value :body, t.get_value(:image)
  end
end

OPTS = {:player => "jordanrw", :item => "cool-thing"}

class TestCatheter < MiniTest::Unit::TestCase
  def test_base
    result = CASCADE.build(:base, OPTS)
    
    assert_equal OPTS[:item], result[:item]
    assert_equal "#{OPTS[:player]}.png", result[:image]
  end
  
  def test_one_layer
    result = CASCADE.build(:contribute_base, OPTS)
    
    assert_equal OPTS[:player], result[:player]
    assert_equal "#{OPTS[:item]}.png", result[:image]
  end
  
  def test_two_layers
    result = CASCADE.build(:contribute_part, OPTS)
    
    assert_equal OPTS[:player], result[:player]
    assert_equal OPTS[:item], result[:item]
    assert_equal "#{OPTS[:item]}.png", result[:image]
    assert_equal result[:image], result[:body]
  end
  
  def test_layers_that_depend_on_layers_that_depend_on_layers
    flunk
  end
  
  def test_layers_that_depend_on_layers_with_different_paths
    flunk
  end
{'fraction_non_alphanumeric': 0.1421623643845866, 'fraction_numerical': 0.0003741114852225963, 'mean_word_length': 4.103053435114504, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1165671', 'n_tokens_mistral': 1001, 'n_tokens_neox': 984, 'n_words': 200}