rbsync 0.0.14 → 0.0.15

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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/rbsync.gemspec +1 -1
  3. data/test/test_rbsync.rb +19 -0
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.14
1
+ 0.0.15
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rbsync}
8
- s.version = "0.0.14"
8
+ s.version = "0.0.15"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["takuya"]
@@ -144,6 +144,25 @@ class TestRbsync < Test::Unit::TestCase
144
144
  end
145
145
  end
146
146
  end
147
+ def test_sync_with_rename_twice
148
+ Dir.mktmpdir('goo') do |dir|
149
+ Dir.chdir dir do
150
+ Dir.mkdir("old")
151
+ Dir.mkdir("new")
152
+ open("./old/test.txt", "w+"){|f| 10.times{f.puts("test")}}
153
+ rsync = RbSync.new
154
+ rsync.sync("old","new")
155
+ assert FileUtils.cmp("old/test.txt","new/test.txt") == true
156
+ open("./old/test.txt", "w+"){|f| 10.times{f.puts("changed")}}
157
+ rsync.sync("old","new",{:rename => true})
158
+ rsync.sync("old","new",{:rename => true})
159
+ rsync.sync("old","new",{:rename => true})
160
+ rsync.sync("old","new",{:rename => true})
161
+ assert FileUtils.cmp("old/test.txt","new/test.txt") == false
162
+ assert FileUtils.cmp("old/test.txt","new/test(1).txt") == true
163
+ end
164
+ end
165
+ end
147
166
  def test_sync_with_backup
148
167
  Dir.mktmpdir('goo') do |dir|
149
168
  Dir.chdir dir do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbsync
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 14
10
- version: 0.0.14
9
+ - 15
10
+ version: 0.0.15
11
11
  platform: ruby
12
12
  authors:
13
13
  - takuya