cloud_encrypted_sync 0.3.3 → 0.3.4

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cloud_encrypted_sync (0.3.3)
4
+ cloud_encrypted_sync (0.3.4)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -22,14 +22,13 @@ module CloudEncryptedSync
22
22
  #######
23
23
 
24
24
  def load
25
- touch_data_folder
26
25
  cache_argv
26
+ touch_data_folder
27
27
  loaded_settings = config_file_settings.merge(command_line_options).with_indifferent_access
28
28
 
29
29
  loaded_settings[:sync_path] = ARGV.shift unless ARGV.empty?
30
30
 
31
31
  validate_settings(loaded_settings)
32
-
33
32
  return loaded_settings
34
33
  end
35
34
 
@@ -1,3 +1,3 @@
1
1
  module CloudEncryptedSync
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  end
@@ -5,10 +5,7 @@ module CloudEncryptedSync
5
5
 
6
6
  def setup
7
7
  unstub_configuration
8
- Configuration.instance_variable_set(:@command_line_options,nil)
9
- Configuration.instance_variable_set(:@settings,nil)
10
- Configuration.instance_variable_set(:@option_parser,nil)
11
- Object.send(:remove_const,:ARGV) #if defined?(::ARGV)
8
+ reset_configuration
12
9
  end
13
10
 
14
11
  test 'should load settings' do
@@ -42,5 +39,33 @@ module CloudEncryptedSync
42
39
  assert File.exist?('/test')
43
40
  end
44
41
 
42
+ test 'different arguments should produce different signature' do
43
+ # setup first signature
44
+ ::ARGV = '--adapter dummy --bucket foobar --data-dir /test --encryption-key somestringofcharacters /some/path'.split(/\s/)
45
+ Configuration.settings
46
+ first_signature = Configuration.signature
47
+
48
+ reset_configuration
49
+
50
+ # setup second signature with different bucket
51
+ ::ARGV = '--adapter dummy --bucket foobar2 --data-dir /test --encryption-key somestringofcharacters /some/path'.split(/\s/)
52
+ Configuration.settings
53
+ second_signature = Configuration.signature
54
+
55
+ refute_equal(first_signature,second_signature)
56
+ end
57
+
58
+ #######
59
+ private
60
+ #######
61
+
62
+ def reset_configuration
63
+ Configuration.instance_variable_set(:@cached_argv,nil)
64
+ Configuration.instance_variable_set(:@command_line_options,nil)
65
+ Configuration.instance_variable_set(:@config_file_settings,nil)
66
+ Configuration.instance_variable_set(:@settings,nil)
67
+ Configuration.instance_variable_set(:@option_parser,nil)
68
+ Object.send(:remove_const,:ARGV)
69
+ end
45
70
  end
46
71
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloud_encrypted_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-29 00:00:00.000000000 Z
12
+ date: 2012-11-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mocha