svn-fixture 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -24,6 +24,7 @@ module SvnFixture
24
24
  # - +options+:
25
25
  # - +:author+: The Revision's author
26
26
  # - +:date+: The date and time of the commit
27
+ # - Additional options will set revprops
27
28
  # - Optionally accepts a block. The block, if given, is run at the time
28
29
  # #commit is called, within the context of the root directory of the
29
30
  # Repository, which is an instance of SvnFixture::Directory. For example:
@@ -35,6 +36,7 @@ module SvnFixture
35
36
  @name, @message, @block = name, message, block
36
37
  @author = options.delete(:author)
37
38
  @date = SvnFixture.svn_time(options.delete(:date))
39
+ @revprops = options
38
40
  end
39
41
 
40
42
  # Processes the changes made in this revision. Normally these would be made
@@ -56,6 +58,9 @@ module SvnFixture
56
58
  repo.repos.fs.set_prop('svn:log', @message, rev) if @message
57
59
  repo.repos.fs.set_prop('svn:author', @author, rev) if @author
58
60
  repo.repos.fs.set_prop('svn:date', @date, rev) if @date
61
+ @revprops.each do | key, val |
62
+ repo.repos.fs.set_prop(key.to_s, val.to_s, rev)
63
+ end
59
64
  else
60
65
  puts "Warning: No change in revision #{name} (SvnFixture::Revision#commit)"
61
66
  end
data/lib/svn-fixture.rb CHANGED
@@ -8,7 +8,7 @@ require "svn/fs"
8
8
  require "svn/repos"
9
9
 
10
10
  module SvnFixture
11
- VERSION = '0.1.2'
11
+ VERSION = '0.1.3'
12
12
 
13
13
  CONFIG_DEFAULTS = {
14
14
  :base_path => File.join(Dir.tmpdir, 'svn-fixture')
@@ -14,6 +14,7 @@ describe SvnFixture::Revision do
14
14
  rev.name.should == 'name'
15
15
  rev.instance_variable_get(:@message).should == 'msg'
16
16
  rev.instance_variable_get(:@author).should == 'author'
17
+ rev.instance_variable_get(:@revprops).should == {}
17
18
  rev.instance_variable_get(:@block).should be_kind_of(Proc)
18
19
  end
19
20
 
@@ -28,7 +29,7 @@ describe SvnFixture::Revision do
28
29
  @repos = SvnFixture::repo('file_test').checkout
29
30
  # @repos_path = @repos.instance_variable_get(:@repos_path)
30
31
  @wc_path = @repos.instance_variable_get(:@wc_path)
31
- @rev = @klass.new(1, 'msg', :author => 'author', :date => Time.parse('2009-01-01 12:00:00Z')) do
32
+ @rev = @klass.new(1, 'msg', :author => 'author', :date => Time.parse('2009-01-01 12:00:00Z'), 'other:revprop' => 20) do
32
33
  dir('test-dir')
33
34
  end
34
35
  @rev.commit(@repos)
@@ -60,6 +61,10 @@ describe SvnFixture::Revision do
60
61
  Time.parse('2009-01-01T12:00:00.000000Z')
61
62
  end
62
63
 
64
+ it 'should set additional revprops if given' do
65
+ @fs.prop('other:revprop', 1).should == '20'
66
+ end
67
+
63
68
  it 'should print warning if no changes' do
64
69
  no_change_rev = @klass.new(2, 'msg')
65
70
  no_change_rev.should_receive(:puts).
data/svn-fixture.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{svn-fixture}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jared Morgan"]
12
- s.date = %q{2009-10-03}
12
+ s.date = %q{2009-10-17}
13
13
  s.description = %q{svn-fixture simplifies creating (or updating) a Subversion repository. It is
14
14
  designed to be used in tests that require a Subversion repo, but can also be
15
15
  used to initialize a repository according to some template. svn-fixture depends
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svn-fixture
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Morgan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-03 00:00:00 -05:00
12
+ date: 2009-10-17 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15