paperclip-storage-tmp 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ ## 0.0.2 (2012-05-12):
2
+
3
+ * Provide one-line testing helpers for RSpec and Cucumber;
4
+ they require the gem and add after hooks which clear the
5
+ tmp storage
6
+
1
7
  ## 0.0.1 (2012-05-11):
2
8
 
3
9
  * Implement `Paperclip::Storage::Tmp.clear` which clears all
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in paperclip-storage-tmp.gemspec
4
4
  gemspec
data/README.md CHANGED
@@ -79,11 +79,17 @@ The most important part is actually "rolling back the filesystem" after every te
79
79
 
80
80
  # in spec/spec_helper.rb
81
81
  RSpec.configure do |config|
82
- config.after do
83
- Paperclip::Storage::Tmp.clear
84
- end
82
+ config.after { Paperclip::Storage::Tmp.clear }
85
83
  end
86
84
 
85
+ Or, just use the provided one-line testing helpers for RSpec and Cucumber, which add the necessary after hooks for you:
86
+
87
+ # in spec/spec_helper.rb
88
+ require 'paperclip-storage-tmp/testing/rspec'
89
+
90
+ # in features/support/env.rb
91
+ require 'paperclip-storage-tmp/testing/cucumber'
92
+
87
93
  ## Caveats
88
94
 
89
95
  Beware that the file name assigned to the model attribute (`<attachment>_file_name`) is different than the name of the assigned/uploaded file (it's the name of the temporary file - a unique string).
@@ -0,0 +1,3 @@
1
+ require 'paperclip-storage-tmp'
2
+
3
+ After { Paperclip::Storage::Tmp.clear }
@@ -0,0 +1,5 @@
1
+ require 'paperclip-storage-tmp'
2
+
3
+ RSpec.configure do |config|
4
+ config.after { Paperclip::Storage::Tmp.clear }
5
+ end
@@ -1,7 +1,7 @@
1
1
  module Paperclip
2
2
  module Storage
3
3
  module Tmp
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
6
6
  end
7
7
  end
@@ -1,9 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Paperclip::Storage::Tmp do
4
- after do
5
- Paperclip::Storage::Tmp.clear
6
- end
4
+ after { Paperclip::Storage::Tmp.clear }
7
5
 
8
6
  let(:avatar_file) { File.new('spec/fixtures/hey_mom_its_me.png') }
9
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip-storage-tmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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-05-11 00:00:00.000000000 Z
12
+ date: 2012-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: paperclip
@@ -74,6 +74,8 @@ files:
74
74
  - README.md
75
75
  - Rakefile
76
76
  - lib/paperclip-storage-tmp.rb
77
+ - lib/paperclip-storage-tmp/testing/cucumber.rb
78
+ - lib/paperclip-storage-tmp/testing/rspec.rb
77
79
  - lib/paperclip-storage-tmp/version.rb
78
80
  - lib/paperclip/storage/tmp.rb
79
81
  - paperclip-storage-tmp.gemspec
@@ -106,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
108
  version: '0'
107
109
  requirements: []
108
110
  rubyforge_project:
109
- rubygems_version: 1.8.23
111
+ rubygems_version: 1.8.24
110
112
  signing_key:
111
113
  specification_version: 3
112
114
  summary: Keep your tests clean by isolating test attachments from development, and