<commit_before>require 'spec_helper'

describe PageRankr do
  describe "#socials" do
    subject{ PageRankr.social_trackers }

    it{ should include(:linked_in) }
    it{ should include(:pinterest) }
    it{ should include(:stumpled_upon) }
    it{ should include(:twitter) }
  end

  describe "#socials", :focus => true do
    describe "success" do
      subject do
        VCR.use_cassette(:success_socials, :record => :new_episodes) do
          PageRankr.socials("http://www.google.com")
        end
      end

      it{ should have_key(:linked_in) }
      it{ should have_key(:pinterest) }
      it{ should have_key(:stumpled_upon) }
      it{ should have_key(:twitter) }

      it{ subject[:linked_in].should > 500 }
      it{ subject[:pinterest].should > 70000 }
      it{ subject[:stumpled_upon].should > 20000 }
      it{ subject[:stumpled_upon].should > 100000 }
    end

    describe "failure" do
      subject do
        VCR.use_cassette(:failure_socials, :record => :new_episodes) do
          PageRankr.socials("http://please-dont-register-a-site-that-breaks-this-test.com")
        end
      end

      it{ should have_key(:linked_in) }

      it{ subject[:linked_in].should == 0 }
      it{ subject[:pinterest].should == 0 }
      it{ subject[:stumpled_upon].should be_nil }
      it{ subject[:twitter].should == 0 }
    end
  end

end<commit_msg>Expanded social specs a bit<commit_after>require 'spec_helper'

describe PageRankr do
  describe "#socials" do
    subject{ PageRankr.social_trackers }

    it{ should include(:linked_in) }
    it{ should include(:pinterest) }
    it{ should include(:stumpled_upon) }
    it{ should include(:twitter) }
  end

  describe "#socials", :focus => true do
    describe "success" do
      subject do
        VCR.use_cassette(:success_socials, :record => :new_episodes) do
          PageRankr.socials("http://www.google.com")
        end
      end

      it{ should have_key(:linked_in) }
      it{ should have_key(:pinterest) }
      it{ should have_key(:stumpled_upon) }
      it{ should have_key(:twitter) }

      it{ subject[:linked_in].should > 500 }
      it{ subject[:pinterest].should > 70000 }
      it{ subject[:stumpled_upon].should > 20000 }
      it{ subject[:stumpled_upon].should > 100000 }
    end

    describe "failure" do
      subject do
        VCR.use_cassette(:failure_socials, :record => :new_episodes) do
          PageRankr.socials("http://please-dont-register-a-site-that-breaks-this-test.com")
        end
      end

      it{ should have_key(:linked_in) }
      it{ should have_key(:pinterest) }
      it{ should have_key(:stumpled_upon) }
      it{ should have_key(:twitter) }

      it{ subject[:linked_in].should == 0 }
      it{ subject[:pinterest].should == 0 }
      it{ subject[:stumpled_upon].should be_nil }
      it{ subject[:twitter].should == 0 }
    end
  end

end
{'fraction_non_alphanumeric': 0.12395251396648045, 'fraction_numerical': 0.015363128491620111, 'mean_word_length': 2.8251001335113486, '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': '471330', 'n_tokens_mistral': 997, 'n_tokens_neox': 926, 'n_words': 202}