trackman 0.6.8 → 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ module Trackman
6
6
 
7
7
  {
8
8
  :create => to_create,
9
- :update => remote.select{|a| local.any?{ |s| a.path == s.path && a.file_hash != s.file_hash }},
9
+ :update => remote.select{|a| local.any?{ |s| a.path == s.path && (a.file_hash != s.file_hash || a.virtual_path != s.virtual_path) }},
10
10
  :delete => define_deleted(local, remote) do |a|
11
11
  to_create.any?{ |c| c.path.basename == a.path.basename }
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module Trackman
2
- VERSION = "0.6.8"
2
+ VERSION = "0.6.9"
3
3
  end
@@ -5,7 +5,7 @@ describe Trackman::Components::Diffable do
5
5
  extend Trackman::Components::Diffable
6
6
  end
7
7
 
8
- it "specify the html to update and the image to delete" do
8
+ it "specifies the html to update and the image to delete" do
9
9
  expected = {
10
10
  :create => [],
11
11
  :update => [Asset.create(:path => 'spec/test_data/sample.html')],
@@ -54,4 +54,20 @@ describe Trackman::Components::Diffable do
54
54
 
55
55
  actual.should eq(expected)
56
56
  end
57
+
58
+ it "updates the asset if the virtual path is different" do
59
+ expected = {
60
+ :create => [],
61
+ :update => [RemoteAsset.create(:path => 'the/path/to/file', :virtual_path => '/path/file')],
62
+ :delete => []
63
+ }
64
+
65
+ asset1 = RemoteAsset.create(:path => 'the/path/to/file', :virtual_path => '/path/file')
66
+ asset2 = RemoteAsset.create(:path => 'the/path/to/file', :virtual_path => 'path/file')
67
+
68
+ actual = TestDiff.diff([asset1], [asset2])
69
+
70
+ actual.should eq(expected)
71
+ end
72
+
57
73
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trackman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.6.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-10-18 00:00:00.000000000 Z
13
+ date: 2012-10-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client