<commit_before>require "spec_helper"

module SocialSnippet::Repository::Drivers

  describe GitDriver, :without_fakefs => true do

    before { disable_fakefs }

    context "github repo" do

      context "clone social-snippet/example-repo" do

        subject(:repo) { fake_core.repo_factory.clone("git://github.com/social-snippet/example-repo.git") }

        context "load snippet.json" do
          before { repo.load_snippet_json }
          it { expect(repo.name).to eq "example-repo" }
        end

        describe "#refs" do
          subject { repo.refs }
          it { should include "master" }
          it { should include "1.0.0" }
          it { should include "1.0.1" }
        end

        describe "#versions" do
          subject { repo.versions }
          it { should_not include "master" }
          it { should include "1.0.0" }
          it { should include "1.0.1" }
        end

        context "checkout 1.0.0" do

          before do
            repo.checkout("1.0.0")
            repo.load_snippet_json
          end

          it { expect(repo.name).to eq "example-repo" }

          describe "#commit_id" do
            subject { repo.commit_id }
            it { should eq "efa58ecae07cf3d063ae75fa97fce164c56d205a" }
          end

          describe "#short_commit_id" do
            subject { repo.short_commit_id }
            it { should eq "efa58eca" }
          end

        end # checkout 1.0.0

        context "checkout 1.0.x (latest)" do

          before do
            repo.checkout(repo.latest_version("1.0"))
            repo.load_snippet_json
          end

          it { expect(repo.name).to eq "example-repo" }

          describe "#commit_id" do
            subject { repo.commit_id }
            it { should eq "38ebf733622174e24d76d28ab264c52b4fd7bda9" }
          end

          describe "#short_commit_id" do
            subject { repo.short_commit_id }
            it { should eq "38ebf733" }
          end

        end # checkout 1.0.x

      end # clone social_snippet/example-repo

    end # github repo

  end # GitDriver

end # SocialSnippet::Repository::Drivers
<commit_msg>git_repository_spec: fix tests<commit_after>require "spec_helper"

module SocialSnippet::Repository::Drivers

  describe GitDriver, :without_fakefs => true do

    context "github repo" do

      context "clone social-snippet/example-repo" do

        subject(:repo) { fake_core.repo_factory.clone("git://github.com/social-snippet/example-repo.git") }
        it { expect(repo.name).to eq "example-repo" }

        describe "#refs" do
          subject { repo.refs }
          it { should include "master" }
          it { should include "1.0.0" }
          it { should include "1.0.1" }
        end

        describe "#versions" do
          subject { repo.versions }
          it { should_not include "master" }
          it { should include "1.0.0" }
          it { should include "1.0.1" }
        end

        describe "#latest_version" do
          subject { repo.latest_version("1.0") }
          it { should eq "1.0.2" }
        end

      end # clone social_snippet/example-repo

    end # github repo

  end # GitDriver

end # SocialSnippet::Repository::Drivers

{'fraction_non_alphanumeric': 0.10090314543755839, 'fraction_numerical': 0.02989722827779508, 'mean_word_length': 1.852575488454707, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5515106', 'n_tokens_mistral': 1029, 'n_tokens_neox': 952, 'n_words': 232}