Sha256: ef03da8aa4fe563ddbe8544edce14541bdfecf31d0b91d10e1ef79d0733fa25a

Contents?: true

Size: 1.2 KB

Versions: 4

Compression:

Stored size: 1.2 KB

Contents

module Rip
  module Sh
    module MockGit
      def git_ls_remote(source, version=nil)
        match_errors = []
        if source != real_source
          match_errors << "source was #{source} instead of #{real_source}"
        end

        if !match_errors.empty?
          raise match_errors.join(" and ")
        end

        "67be542ddad55c502daf12fde4f784d88a248617\tHEAD\n67be542ddad55c502daf12fde4f784d88a248617\trefs/heads/master"
      end

      def git_fetch(repothing)
      end

      def git_clone(source, cache_name)
        match_errors = []
        if source != real_source
          match_errors << "source was #{source} instead of #{real_source}"
        end
        if !match_errors.empty?
          raise match_errors.join(" and ")
        end

        FakeFS::FileSystem.clone(repo_path(real_repo_name))
        FileUtils.mv(repo_path(real_repo_name), cache_name)
      end

      def git_submodule_init
      end

      def git_submodule_update
      end

      def git_reset_hard(version)
      end

      def git_cat_file(object)
        ''
      end

      def real_repo_name
        raise NotImplementedError
      end

      def real_source
        raise NotImplementedError
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rip-0.0.4 test/mock_git.rb
rip-0.0.5 test/mock_git.rb
rip-0.0.3 test/mock_git.rb
rip-0.0.2 test/mock_git.rb