Skip to content

Commit

Permalink
Add test for the return of file command in *nix
Browse files Browse the repository at this point in the history
  • Loading branch information
sikachu committed Apr 24, 2012
1 parent 9ddfc6a commit 3d814fb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/file_adapter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ class FileAdapterTest < Test::Unit::TestCase
assert_kind_of String, @subject.content_type
end
end

context "file with content type derived from file command on *nix" do
setup do
MIME::Types.stubs(:type_for).returns([])
Paperclip.stubs(:run).returns("application/vnd.ms-office\n")
end

should "return content type without newline character" do
assert_equal "application/vnd.ms-office", @subject.content_type
end
end
end

context "empty file" do
Expand Down

0 comments on commit 3d814fb

Please sign in to comment.