sashimi 0.2.1 → 0.2.2

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/CHANGELOG CHANGED
@@ -1,3 +1,11 @@
1
+ * *v0.2.2*
2
+
3
+ * Tagged v0.2.2
4
+
5
+ * Force File#atomic_write to use the current directory as temp path. [#16 state:resolved]
6
+
7
+
8
+
1
9
  * *v0.2.1*
2
10
 
3
11
  * Tagged v0.2.1
@@ -296,7 +296,7 @@ module Sashimi
296
296
 
297
297
  # Write all the plugins into the cache
298
298
  def write_to_cache(plugins)
299
- File.atomic_write(cache_file) do |file|
299
+ File.atomic_write(cache_file, "./") do |file|
300
300
  file.write(plugins.to_yaml)
301
301
  end
302
302
  end
@@ -2,7 +2,7 @@ module Sashimi #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "sashimi"
3
- s.version = "0.2.1"
4
- s.date = "2008-09-29"
3
+ s.version = "0.2.2"
4
+ s.date = "2008-10-03"
5
5
  s.summary = "Rails plugins manager"
6
6
  s.author = "Luca Guidi"
7
7
  s.email = "guidi.luca@gmail.com"
@@ -241,40 +241,46 @@ class AbstractRepositoryTest < Test::Unit::TestCase
241
241
  assert_equal cached_plugins, repository.class.cache_content
242
242
  end
243
243
 
244
- def test_should_add_a_new_plugin_to_cache
245
- with_clear_cache do
246
- with_path local_repository_path do
247
- create_plugin_directory('brand_new')
248
- plugin = create_plugin(nil, 'git://github.com/jodosha/brand_new.git')
249
- repository.add_to_cache(plugin)
250
- assert_equal cached_plugins.merge(plugin.to_hash), repository.class.cache_content
244
+ uses_mocha 'TestAbstractRepositoryCache' do
245
+ def test_should_add_a_new_plugin_to_cache
246
+ with_clear_cache do
247
+ with_path local_repository_path do
248
+ create_plugin_directory('brand_new')
249
+ plugin = create_plugin(nil, 'git://github.com/jodosha/brand_new.git')
250
+ repository.add_to_cache(plugin)
251
+ assert_equal cached_plugins.merge(plugin.to_hash), repository.class.cache_content
252
+ end
251
253
  end
252
254
  end
253
- end
254
-
255
- def test_should_merge_an_existent_plugin_into_cache
256
- with_clear_cache do
257
- with_path local_repository_path do
258
- repository.add_to_cache(plugin)
259
- assert_equal cached_plugins.merge(plugin.to_hash), repository.class.cache_content
255
+
256
+ def test_should_merge_an_existent_plugin_into_cache
257
+ File.expects(:atomic_write).with('.plugins', "./")
258
+ with_clear_cache do
259
+ with_path local_repository_path do
260
+ repository.add_to_cache(plugin)
261
+ assert_equal cached_plugins.merge(plugin.to_hash), repository.class.cache_content
262
+ end
260
263
  end
261
264
  end
262
- end
263
-
264
- def test_remove_from_cache
265
- with_clear_cache do
266
- with_path local_repository_path do
267
- repository.remove_from_cache
268
- assert_not repository.class.plugins_names.include?(plugin.name)
265
+
266
+ def test_remove_from_cache
267
+ File.expects(:atomic_write).with('.plugins', "./")
268
+ with_clear_cache do
269
+ with_path local_repository_path do
270
+ repository.remove_from_cache
271
+ assert_not repository.class.plugins_names.include?(plugin.name)
272
+ end
269
273
  end
270
274
  end
271
- end
272
-
273
- def test_write_to_cache
274
- with_clear_cache do
275
- with_path plugins_path do
276
- repository.write_to_cache(plugin.to_hash)
277
- assert_equal plugin.to_hash, repository.class.cache_content
275
+
276
+ def test_write_to_cache
277
+ File.expects(:atomic_write).with('.plugins', "./")
278
+ repository.class.expects(:cache_content).returns plugin.to_hash # mock the atomic write result
279
+ with_clear_cache do
280
+ with_path plugins_path do
281
+ repository.write_to_cache(plugin.to_hash)
282
+ assert_equal plugin.to_hash, repository.class.cache_content
283
+ end
278
284
  end
279
285
  end
280
286
  end
@@ -3,6 +3,6 @@ require 'test/test_helper'
3
3
 
4
4
  class VersionTest < Test::Unit::TestCase
5
5
  def test_version
6
- assert_equal '0.2.1', Sashimi::VERSION::STRING
6
+ assert_equal '0.2.2', Sashimi::VERSION::STRING
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sashimi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-29 00:00:00 +02:00
12
+ date: 2008-10-03 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency