<commit_before>require File.join(File.dirname(__FILE__), "spec_helper.rb")

describe Smoke do
  before do
    @source_a = TestSource.source :a
    @source_b = TestSource.source :b
    @source_c = TestSource.source :c
  end
  
  describe "registration" do
    before do
      Smoke.register(Smoke::SecretSauce) # defined in supports/mayo.rb
    end
    
    it "should allow sources to register themselves" do
      Smoke.included_modules.should include(SecretSauce)
    end
    
    it "should have an instance method of 'mayo'" do
      Smoke.instance_methods.should include("mayo")
    end
  end
  
  describe "joining" do
    before do
      @joined = Smoke.join(:a, :b)
    end
    
    it "should contain items from sources a and b" do
      @joined.output.size.should == (@source_a.output.size + @source_b.output.size)
    end
    
    it "should accept a block"
    it "should allow sorting"
    it "should allow renaming"
    it "should allow changes to output"
  end
  
  describe "active sources" do
    it "should allow access to sources via an array accessor" do
      Smoke[:a].should be_an_instance_of(Smoke::Origin)
    end
  end
end<commit_msg>Filled out some specs for joining sources together<commit_after>require File.join(File.dirname(__FILE__), "spec_helper.rb")

describe Smoke do
  before do
    @source_a = TestSource.source :a
    @source_b = TestSource.source :b
    @source_c = TestSource.source :c
  end
  
  describe "registration" do
    before do
      Smoke.register(Smoke::SecretSauce) # defined in supports/mayo.rb
    end
    
    it "should allow sources to register themselves" do
      Smoke.included_modules.should include(SecretSauce)
    end
    
    it "should have an instance method of 'mayo'" do
      Smoke.instance_methods.should include("mayo")
    end
  end
  
  describe "joining" do
    before do
      @joined = Smoke.join(:a, :b)
    end
    
    it "should contain items from sources a and b" do
      @joined.output.size.should == (@source_a.output.size + @source_b.output.size)
    end
    
    it "should accept a block" do
      lambda { Smoke.join(:a, :b, Proc.new {}) }.should_not raise_error
    end
    
    it "should allow sorting" do
      Smoke.join(:a, :b).should respond_to(:sort)
    end
    
    it "should allow renaming" do
      Smoke.join(:a, :b).should respond_to(:rename)
    end
    
    it "should allow changes to output" do
      Smoke.join(:a, :b).should respond_to(:output)
    end
  end
  
  describe "active sources" do
    it "should allow access to sources via an array accessor" do
      Smoke[:a].should be_an_instance_of(Smoke::Origin)
    end
  end
end
{'fraction_non_alphanumeric': 0.09046177138531415, 'fraction_numerical': 0.0, 'mean_word_length': 2.781115879828326, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4967065', 'n_tokens_mistral': 862, 'n_tokens_neox': 853, 'n_words': 259}