Sha256: ebc50bbc1d3984d9192ad79a04bd9ea0c01dda81c171f1df194fb98df2809559

Contents?: true

Size: 1.02 KB

Versions: 11

Compression:

Stored size: 1.02 KB

Contents

require File.dirname(__FILE__) + '/helper'

describe Mercurial::Hook do
  
  before do
    @repository = Mercurial::Repository.create('/tmp/test-hg-repo')
    stub_hgrc(@repository.config.path)
    @hook = @repository.hooks.by_name('changegroup')    
  end
  
  after do
    @repository.destroy!
  end
  
  it "should have name" do
    @hook.name.must_equal 'changegroup'
  end
  
  it "should have value" do
    @hook.value.must_equal '/Users/ilya/work/beanstalk/script/mercurial/changegroup.rb'
  end
  
  it "should have repository" do
    @hook.repository.must_equal @repository
  end
  
  it "should add itself to the config" do
    hook = Mercurial::Hook.new(@repository, 'outcoming', 'hg update')
    hook.save
    @repository.hooks.by_name('outcoming').value.must_equal 'hg update'
  end
  
  it "should remove itself from the config" do
    @hook.destroy!
    @repository.hooks.by_name('changegroup').must_equal nil
    @repository.hooks.by_name('commit').value.must_equal '/Users/ilya/work/beanstalk/script/mercurial/commit.rb'
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mercurial-ruby-0.7.12 test/test_hook.rb
mercurial-ruby-0.7.11 test/test_hook.rb
mercurial-ruby-0.7.10 test/test_hook.rb
mercurial-ruby-0.7.9 test/test_hook.rb
mercurial-ruby-0.7.8 test/test_hook.rb
mercurial-ruby-0.7.7 test/test_hook.rb
mercurial-ruby-0.7.6 test/test_hook.rb
mercurial-ruby-0.7.5 test/test_hook.rb
mercurial-ruby-0.7.4 test/test_hook.rb
mercurial-ruby-0.7.3 test/test_hook.rb
mercurial-ruby-0.7.2 test/test_hook.rb