Sha256: 2dff8d75eaaa8cc03edebb48a128eac2c7403aeffb3f611cdeec2c52480d1074

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

module Rip
  module Sh
    module MockGit
      def git_ls_remote(source, version)
        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 real_repo_name
        raise NotImplementedError
      end

      def real_source
        raise NotImplementedError
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rip-0.0.1 test/mock_git.rb