diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 04:13:16 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 04:13:16 +0200 |
| commit | e0a7e0fec760ba12c8067a37e10c96f1f05876e2 (patch) | |
| tree | d0cf745592a46aee4d4913911fd34c7c24515220 /vendor/plugins/paperclip/test/iostream_test.rb | |
| parent | 6424e10be5a89f175a74c71c55660412a169b8b8 (diff) | |
Stage 1 complete: Rails 2.3.5 to Rails 3.2.22.5 upgrade
- Converted plugins to gems (Gemfile)
- Updated config structure (application.rb, boot.rb, environment.rb)
- Converted routes to Rails 3 DSL
- Converted named_scope to scope throughout models
- Converted find(:all, :conditions) to where() chains
- Fixed has_many :order to use ordering scope
- Updated session store and secret token configuration
- Fixed exception_notification middleware configuration
- Patched Ruby 2.4 / Rails 3.2 incompatibilities:
- Integer/Float duration arithmetic (ActiveSupport)
- Arel visit_Integer for PostgreSQL adapter
- create_database String/Integer coercion
- ActionController consider_all_requests_local
- Migrated taggings schema for acts-as-taggable-on
- Replaced dynamic_form gem with custom form_error_messages helper
- Fixed Rails 3 block helper syntax (form_for, form_tag, fields_for)
- Fixed admin layout yield
- Updated test suite for Rails 3 APIs
Diffstat (limited to 'vendor/plugins/paperclip/test/iostream_test.rb')
| -rw-r--r-- | vendor/plugins/paperclip/test/iostream_test.rb | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/vendor/plugins/paperclip/test/iostream_test.rb b/vendor/plugins/paperclip/test/iostream_test.rb deleted file mode 100644 index 97030b50..00000000 --- a/vendor/plugins/paperclip/test/iostream_test.rb +++ /dev/null | |||
| @@ -1,71 +0,0 @@ | |||
| 1 | require 'test/helper' | ||
| 2 | |||
| 3 | class IOStreamTest < Test::Unit::TestCase | ||
| 4 | context "IOStream" do | ||
| 5 | should "be included in IO, File, Tempfile, and StringIO" do | ||
| 6 | [IO, File, Tempfile, StringIO].each do |klass| | ||
| 7 | assert klass.included_modules.include?(IOStream), "Not in #{klass}" | ||
| 8 | end | ||
| 9 | end | ||
| 10 | end | ||
| 11 | |||
| 12 | context "A file" do | ||
| 13 | setup do | ||
| 14 | @file = File.new(File.join(File.dirname(__FILE__), "fixtures", "5k.png"), 'rb') | ||
| 15 | end | ||
| 16 | |||
| 17 | teardown { @file.close } | ||
| 18 | |||
| 19 | context "that is sent #stream_to" do | ||
| 20 | |||
| 21 | context "and given a String" do | ||
| 22 | setup do | ||
| 23 | FileUtils.mkdir_p(File.join(ROOT, 'tmp')) | ||
| 24 | assert @result = @file.stream_to(File.join(ROOT, 'tmp', 'iostream.string.test')) | ||
| 25 | end | ||
| 26 | |||
| 27 | should "return a File" do | ||
| 28 | assert @result.is_a?(File) | ||
| 29 | end | ||
| 30 | |||
| 31 | should "contain the same data as the original file" do | ||
| 32 | @file.rewind; @result.rewind | ||
| 33 | assert_equal @file.read, @result.read | ||
| 34 | end | ||
| 35 | end | ||
| 36 | |||
| 37 | context "and given a Tempfile" do | ||
| 38 | setup do | ||
| 39 | tempfile = Tempfile.new('iostream.test') | ||
| 40 | tempfile.binmode | ||
| 41 | assert @result = @file.stream_to(tempfile) | ||
| 42 | end | ||
| 43 | |||
| 44 | should "return a Tempfile" do | ||
| 45 | assert @result.is_a?(Tempfile) | ||
| 46 | end | ||
| 47 | |||
| 48 | should "contain the same data as the original file" do | ||
| 49 | @file.rewind; @result.rewind | ||
| 50 | assert_equal @file.read, @result.read | ||
| 51 | end | ||
| 52 | end | ||
| 53 | |||
| 54 | end | ||
| 55 | |||
| 56 | context "that is sent #to_tempfile" do | ||
| 57 | setup do | ||
| 58 | assert @tempfile = @file.to_tempfile | ||
| 59 | end | ||
| 60 | |||
| 61 | should "convert it to a Tempfile" do | ||
| 62 | assert @tempfile.is_a?(Tempfile) | ||
| 63 | end | ||
| 64 | |||
| 65 | should "have the Tempfile contain the same data as the file" do | ||
| 66 | @file.rewind; @tempfile.rewind | ||
| 67 | assert_equal @file.read, @tempfile.read | ||
| 68 | end | ||
| 69 | end | ||
| 70 | end | ||
| 71 | end | ||
