<commit_before>describe "Formats - Block Constructed" do
  include_context "db"

  # After a while WotC abandoned block constructed, so we're making things up here
  describe "Block legal sets" do
    let(:start_date) { db.sets["ice"].release_date }
    let(:end_date) { db.sets["rix"].release_date }
    let(:block_formats) { Format.formats_index.select{|k,v| k =~ /block\z/}.values.uniq }
    let(:expansion_sets) { db.sets.values.select{|s| s.types.include?("expansion") } }
    let(:expected) { expansion_sets.select{|s| s.release_date >= start_date and s.release_date <= end_date and s.code != "hml" }.map(&:code).to_set }
    let(:actual) { block_formats.map{|f| f.new.included_sets.to_a }.flatten.to_set }
    it do
      expected.should eq actual
    end
  end

  describe "Un legal sets" do
    let(:unsets) { db.sets.values.select{|s| s.types.include?("un") } }
    let(:expected) { unsets.map(&:code).to_set }
    let(:actual) { FormatUnsets.new.included_sets }
    it do
      expected.should eq actual
    end
  end

  ## Individual Block Constructed Formats

  it "ice_age" do
    assert_block_composition "ice age block", "ice", ["ice"],
      "Amulet of Quoz" => "banned"
    assert_block_composition "ice age block", "all", ["ice", "all"],
      "Amulet of Quoz" => "banned"
    assert_block_composition "ice age block", "csp", ["ice", "all", "csp"],
      "Thawing Glaciers" => "banned",
      "Zuran Orb" => "banned",
      "Amulet of Quoz" => "banned"
  end

  it "mirage" do
    assert_block_composition_sequence "mirage block", "mir", "vis", "wth"
  end

  it "tempest" do
    # No idea when Cursed Scroll was banned exactly
    assert_block_composition "tempest block", "tmp", ["tmp"],<commit_msg>Unsets block spec fixes, tbh maybe I should just remove it<commit_after>describe "Formats - Block Constructed" do
  include_context "db"

  # After a while WotC abandoned block constructed, so we're making things up here
  describe "Block legal sets" do
    let(:start_date) { db.sets["ice"].release_date }
    let(:end_date) { db.sets["rix"].release_date }
    let(:block_formats) { Format.formats_index.select{|k,v| k =~ /block\z/}.values.uniq }
    let(:expansion_sets) { db.sets.values.select{|s| s.types.include?("expansion") } }
    let(:expected) { expansion_sets.select{|s| s.release_date >= start_date and s.release_date <= end_date and s.code != "hml" }.map(&:code).to_set }
    let(:actual) { block_formats.map{|f| f.new.included_sets.to_a }.flatten.to_set }
    it do
      expected.should eq actual
    end
  end

  # I don't even know what this means anymore
  describe "Un legal sets" do
    let(:unsets) { db.sets.values.select{|s| s.types.include?("un") } }
    let(:expected) { unsets.map(&:code).to_set - ["unf"] }
    let(:actual) { FormatUnsets.new.included_sets }
    it do
      expected.should eq actual
    end
  end

  ## Individual Block Constructed Formats

  it "ice_age" do
    assert_block_composition "ice age block", "ice", ["ice"],
      "Amulet of Quoz" => "banned"
    assert_block_composition "ice age block", "all", ["ice", "all"],
      "Amulet of Quoz" => "banned"
    assert_block_composition "ice age block", "csp", ["ice", "all", "csp"],
      "Thawing Glaciers" => "banned",
      "Zuran Orb" => "banned",
      "Amulet of Quoz" => "banned"
  end

  it "mirage" do
    assert_block_composition_sequence "mirage block", "mir", "vis", "wth"
  end

  it "tempest" do
    # No idea when Cursed Scroll was banned exactly
    assert_block_composition "tempest block", "tmp", ["tmp"],
{'fraction_non_alphanumeric': 0.14967523298503246, 'fraction_numerical': 0.0, 'mean_word_length': 3.630065359477124, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '658799', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1214, 'n_words': 318}