<commit_before>require 'spec_helper'

describe SportsSouth::Inventory do

  describe '.list_new_text' do
    let(:options) do
      {
        username: 'usr',
        password: 'pa$$',
        source: 'gem',
        customer_number: '1234',
        since: '06/19/2017'
      }
    end
    let(:expectation) do
      [
        {
          item_number: "38317",
          text: "Kahr Arms S9 features a black polymer frame with accessory rail."
        }, {
          item_number: "39303",
          text: "The Steyr Mannlicher Pro Hunter offers a modern compliment to other traditional platforms."
        }, {
          item_number: "33625", 
          text: ""
        }
      ]
    end

    before do
      stub_request(:post, "http://webservices.theshootingwarehouse.com/smart/inventory.asmx/ListNewText").
        with(body: {
            "CustomerNumber" => "1234",
            "DateFrom" => "06/19/2017",
            "Password" => "pa$$",
            "Source"   => "gem",
            "UserName" => "usr"
          }, headers: {
            'Content-Type' => 'application/x-www-form-urlencoded',
            'User-Agent'   => 'sports_south rubygems.org/gems/sports_south v(1.2.1)'
          }).
        to_return(status: 200, body: sample_list_new_text)

      @response = SportsSouth::Inventory.list_new_text(options)
    end

    it { expect(@response).to eq(expectation) }
  end

end<commit_msg>Pass version into request stub<commit_after>require 'spec_helper'

describe SportsSouth::Inventory do

  describe '.list_new_text' do
    let(:options) do
      {
        username: 'usr',
        password: 'pa$$',
        source: 'gem',
        customer_number: '1234',
        since: '06/19/2017'
      }
    end
    let(:expectation) do
      [
        {
          item_number: "38317",
          text: "Kahr Arms S9 features a black polymer frame with accessory rail."
        }, {
          item_number: "39303",
          text: "The Steyr Mannlicher Pro Hunter offers a modern compliment to other traditional platforms."
        }, {
          item_number: "33625", 
          text: ""
        }
      ]
    end

    before do
      stub_request(:post, "http://webservices.theshootingwarehouse.com/smart/inventory.asmx/ListNewText").
        with(body: {
            "CustomerNumber" => "1234",
            "DateFrom" => "06/19/2017",
            "Password" => "pa$$",
            "Source"   => "gem",
            "UserName" => "usr"
          }, headers: {
            'Content-Type' => 'application/x-www-form-urlencoded',
            'User-Agent'   => "sports_south rubygems.org/gems/sports_south v(#{SportsSouth::VERSION})"
          }).
        to_return(status: 200, body: sample_list_new_text)

      @response = SportsSouth::Inventory.list_new_text(options)
    end

    it { expect(@response).to eq(expectation) }
  end

end
{'fraction_non_alphanumeric': 0.13058782118972193, 'fraction_numerical': 0.03132699753607884, 'mean_word_length': 1.975916230366492, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4721271', 'n_tokens_mistral': 935, 'n_tokens_neox': 855, 'n_words': 185}