<commit_before>require 'spec_helper'

describe Tankard::Client do

  let(:client) { Tankard::Client.new({api_key: "abc123"}) }

  describe "#beer" do

    context "when called" do

      it "does not reuse an existing beer object" do
        first_beer = client.beer
        expect(first_beer.object_id != client.beer.object_id).to be_true
      end
    end

    context "when passed a hash of options" do

      before do
        @request = mock("request")
        Tankard::Request.stub!(:new).and_return(@request)
      end

      it "passes the options to the beer object" do
        Tankard::Api::Beer.should_receive(:new).with(@request, {test: 123})
        client.beer({test: 123})
      end
    end
  end

  describe "#beers" do

    context "when called" do

      it "does not reuse an existing beer object" do
        beers = client.beers
        expect(beers.object_id != client.beers.object_id).to be_true
      end
    end

    context "when passed a hash of options" do

      before do 
        @request = mock("request")
        Tankard::Request.stub!(:new).and_return(@request)
      end

      it "passes the options to the beer object" do
        Tankard::Api::Beers.should_receive(:new).with(@request, {test: 123})
        client.beers({test: 123})
      end
    end
  end

  describe "#styles" do

    context "when called" do

      it "does not reuse an existing beer object" do
        styles = client.styles
        expect(styles.object_id != client.styles.object_id).to be_true
      end
    end
  end
end<commit_msg>fix typo in client styles test<commit_after>require 'spec_helper'

describe Tankard::Client do

  let(:client) { Tankard::Client.new({api_key: "abc123"}) }

  describe "#beer" do

    context "when called" do

      it "does not reuse an existing beer object" do
        first_beer = client.beer
        expect(first_beer.object_id != client.beer.object_id).to be_true
      end
    end

    context "when passed a hash of options" do

      before do
        @request = mock("request")
        Tankard::Request.stub!(:new).and_return(@request)
      end

      it "passes the options to the beer object" do
        Tankard::Api::Beer.should_receive(:new).with(@request, {test: 123})
        client.beer({test: 123})
      end
    end
  end

  describe "#beers" do

    context "when called" do

      it "does not reuse an existing beer object" do
        beers = client.beers
        expect(beers.object_id != client.beers.object_id).to be_true
      end
    end

    context "when passed a hash of options" do

      before do 
        @request = mock("request")
        Tankard::Request.stub!(:new).and_return(@request)
      end

      it "passes the options to the beer object" do
        Tankard::Api::Beers.should_receive(:new).with(@request, {test: 123})
        client.beers({test: 123})
      end
    end
  end

  describe "#styles" do

    context "when called" do

      it "does not reuse an existing styles object" do
        styles = client.styles
        expect(styles.object_id != client.styles.object_id).to be_true
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10241545893719807, 'fraction_numerical': 0.00966183574879227, 'mean_word_length': 2.4742729306487696, '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': '7560124', 'n_tokens_mistral': 1021, 'n_tokens_neox': 944, 'n_words': 286}