Sha256: 4c4e379f70d244429e264bfabd9703b363b662e0b1e64d96e2f79832d1ca7b3c

Contents?: true

Size: 916 Bytes

Versions: 3

Compression:

Stored size: 916 Bytes

Contents

require 'test/unit'
require File.dirname(__FILE__) + '/../lib/ginst'
require 'rubygems'
require 'grit'
require 'mocha'

def mock_repo
  repo = mock('Grit::Repo')
  repo.stubs(:'is_a?').with(::Grit::Repo).returns(true)    
  repo.stubs(:path).with().returns('path')    
  repo.stubs(:bare).with().returns('false')    
  
  branch = mock('Grit::Branch')
  branch.stubs(:name).with().returns('master')
  
  repo.stubs(:branches).with().returns([branch])
  Grit::Repo.stubs(:new).returns(repo)
  
  repo
end

def mock_ginst
  repo = mock_repo
  
  ginst = mock('Ginst::Ginst')
  ginst.stubs(:add_project)
  
  project = mock('Ginst::Project')
  project.stubs(:name).returns('test_project')
  project.stubs(:branches).returns(repo.branches)
  project.stubs(:branch).with('master').returns([])
  
  ginst.stubs(:[]).returns(project)
  ginst.stubs(:projects).returns([project])
  Ginst::Ginst.stubs(:new).returns(ginst)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ginst-0.1.2 test/test_helper.rb
ginst-0.1.3 test/test_helper.rb
ginst-0.2.2 test/test_helper.rb