<commit_before>require "spec_helper"
require "hamster/core_ext/io"

describe IO do
  describe "#to_list" do

    after(:each) do
      io.close
    end

    context "with a File" do
      let(:io) { File.new(fixture_path("io_spec.txt")) }

      it "returns an equivalent list" do
        fixture("io_spec.txt").to_list.should == Hamster.list("A\n", "B\n", "C\n")
      end
    end

    context "with a StringIO" do
      let(:io) { StringIO.new(fixture("io_spec.txt")) }

      it "returns an equivalent list" do
        StringIO.new("A\nB\nC\n").to_list.should == Hamster.list("A\n", "B\n", "C\n")
      end
    end
  end
end<commit_msg>We want the tests to use the new syntax<commit_after>require "spec_helper"
require "hamster/core_ext/io"

describe IO do
  describe "#to_list" do
    let(:list) { Hamster.list("A\n", "B\n", "C\n") }
    let(:to_list) { io.to_list }

    after(:each) do
      io.close
    end

    context "with a File" do
      let(:io) { File.new(fixture_path("io_spec.txt")) }

      it "returns an equivalent list" do
        expect(to_list).to eq(list)
      end
    end

    context "with a StringIO" do
      let(:io) { StringIO.new(fixture("io_spec.txt")) }

      it "returns an equivalent list" do
        expect(to_list).to eq(list)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.1423047177107502, 'fraction_numerical': 0.0, 'mean_word_length': 2.5844875346260388, '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': '1189095', 'n_tokens_mistral': 478, 'n_tokens_neox': 466, 'n_words': 117}