<commit_before>require "../spec_helper"

describe "Basic examples" do
  it "no args" do
    lines = capture_lines do |output|
      Crul::CLI.run!([] of String, output).should be_false
    end

    lines.first.should match(/\AUsage:/)
    lines[-2].should match(/Please specify URL/)
  end

  it "help" do
    lines = capture_lines do |output|
      Crul::CLI.run!(["-h"], output).should be_true
    end

    lines.first.should match(/\AUsage:/)
  end

  it "most basic GET" do
    WebMock.stub(:get, "http://example.org/").to_return(body: "Hello", headers: { "Hello" => "World" })

    lines = capture_lines do |output|
      Crul::CLI.run!(["http://example.org"], output).should be_true
    end

    lines.first.should eq("HTTP/1.1 200 OK")
    lines[2].should eq("Hello: World")
    lines.last.should eq("Hello")
  end
<commit_msg>Fix line count in spec<commit_after>require "../spec_helper"

describe "Basic examples" do
  it "no args" do
    lines = capture_lines do |output|
      Crul::CLI.run!([] of String, output).should be_false
    end

    lines.first.should match(/\AUsage:/)
    lines.last.should match(/Please specify URL/)
  end

  it "help" do
    lines = capture_lines do |output|
      Crul::CLI.run!(["-h"], output).should be_true
    end

    lines.first.should match(/\AUsage:/)
  end

  it "most basic GET" do
    WebMock.stub(:get, "http://example.org/").to_return(body: "Hello", headers: { "Hello" => "World" })

    lines = capture_lines do |output|
      Crul::CLI.run!(["http://example.org"], output).should be_true
    end

    lines.first.should eq("HTTP/1.1 200 OK")
    lines[2].should eq("Hello: World")
    lines.last.should eq("Hello")
  end

{'fraction_non_alphanumeric': 0.1632896305125149, 'fraction_numerical': 0.0077473182359952325, 'mean_word_length': 3.0457831325301203, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4867733', 'n_tokens_mistral': 585, 'n_tokens_neox': 568, 'n_words': 144}