<commit_before>require 'spec_helper'

module Sphere
  describe Products do
    before do
      @prod = Sphere::Products.new "myProject", nil
    end
    describe '#list' do
      it 'no products' do
        Excon.stub(
          { :method => :get, :path => '/api/p/products' },
          { :status => 200, :body => '{"total":0}' })

        o, e = capture_outs { @prod.list({ :project => 'p' }, {}) }
        o.should match /^No products found in project with key 'p'.$/
      end
      it 'just works' do
        Excon.stub(
          { :method => :get, :path => '/api/some-proj/products' },
          { :status => 200, :body => '{"total":2}' })

        expect { @prod.list({ :project => 'some-proj' }, {}) }.to_not raise_error
      end
    end<commit_msg>Fix test by passing global para argument.<commit_after>require 'spec_helper'

module Sphere
  describe Products do
    before do
      @prod = Sphere::Products.new "myProject", { :para => 1 }
    end
    describe '#list' do
      it 'no products' do
        Excon.stub(
          { :method => :get, :path => '/api/p/products' },
          { :status => 200, :body => '{"total":0}' })

        o, e = capture_outs { @prod.list({ :project => 'p' }, {}) }
        o.should match /^No products found in project with key 'p'.$/
      end
      it 'just works' do
        Excon.stub(
          { :method => :get, :path => '/api/some-proj/products' },
          { :status => 200, :body => '{"total":2}' })

        expect { @prod.list({ :project => 'some-proj' }, {}) }.to_not raise_error
      end
    end
{'fraction_non_alphanumeric': 0.17726396917148363, 'fraction_numerical': 0.010918432883750802, 'mean_word_length': 2.1285140562248994, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 24, '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': '5607458', 'n_tokens_mistral': 517, 'n_tokens_neox': 501, 'n_words': 142}