<commit_before>require 'spec_helper'

describe Bundler::Dsl do
  before do
    @rubygems = mock("rubygems")
    Bundler::Source::Rubygems.stub(:new){ @rubygems }
  end

  describe "#_normalize_options" do
    it "converts :github to :git" do
      subject.gem("sparks", :github => "indirect/sparks")
      github_uri = "git://github.com/indirect/sparks.git"
      expect(subject.dependencies.first.source.uri).to eq(github_uri)
    end

    it "converts numeric :gist to :git" do
      subject.gem("not-really-a-gem", :gist => 2859988)
      github_uri = "https://gist.github.com/2859988.git"
      expect(subject.dependencies.first.source.uri).to eq(github_uri)
    end

    it "converts :gist to :git" do
      subject.gem("not-really-a-gem", :gist => "2859988")
      github_uri = "https://gist.github.com/2859988.git"
      expect(subject.dependencies.first.source.uri).to eq(github_uri)
    end

    it "converts 'rails' to 'rails/rails'" do
      subject.gem("rails", :github => "rails")<commit_msg>Use double instead of mock to avoid spec warnings<commit_after>require 'spec_helper'

describe Bundler::Dsl do
  before do
    @rubygems = double("rubygems")
    Bundler::Source::Rubygems.stub(:new){ @rubygems }
  end

  describe "#_normalize_options" do
    it "converts :github to :git" do
      subject.gem("sparks", :github => "indirect/sparks")
      github_uri = "git://github.com/indirect/sparks.git"
      expect(subject.dependencies.first.source.uri).to eq(github_uri)
    end

    it "converts numeric :gist to :git" do
      subject.gem("not-really-a-gem", :gist => 2859988)
      github_uri = "https://gist.github.com/2859988.git"
      expect(subject.dependencies.first.source.uri).to eq(github_uri)
    end

    it "converts :gist to :git" do
      subject.gem("not-really-a-gem", :gist => "2859988")
      github_uri = "https://gist.github.com/2859988.git"
      expect(subject.dependencies.first.source.uri).to eq(github_uri)
    end

    it "converts 'rails' to 'rails/rails'" do
      subject.gem("rails", :github => "rails")
{'fraction_non_alphanumeric': 0.1484375, 'fraction_numerical': 0.02734375, 'mean_word_length': 3.4064516129032256, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 4, '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': '2232558', 'n_tokens_mistral': 777, 'n_tokens_neox': 706, 'n_words': 141}