Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed failing UnwritableDataDirTest

  • Loading branch information...
commit f7171955ef715fb8af8c07f1d0d863d330bc37b8 1 parent ee21249
@dlindahl dlindahl authored
View
2  lib/geminabox.rb
@@ -82,8 +82,8 @@ def fixup_bundler_rubygems!
post '/upload' do
if File.exists? Geminabox.data
- error_response( 500, "Please ensure #{File.expand_path(Geminabox.data)} is writable by the geminabox web server." ) unless File.writable? Geminabox.data
error_response( 500, "Please ensure #{File.expand_path(Geminabox.data)} is a directory." ) unless File.directory? Geminabox.data
+ error_response( 500, "Please ensure #{File.expand_path(Geminabox.data)} is writable by the geminabox web server." ) unless File.writable? Geminabox.data
else
begin
FileUtils.mkdir_p(settings.data)
View
17 test/integration/pushing_gems/data_dir_errors_test.rb
@@ -9,10 +9,23 @@ class InvalidDataDirTest < Geminabox::TestCase
end
class UnwritableDataDirTest < Geminabox::TestCase
- data "/"
+ def setup
+ super
+
+ FileUtils.mkdir '/tmp/read_only'
+ FileUtils.chmod 0444, '/tmp/read_only'
+ end
+
+ def teardown
+ super
+
+ FileUtils.rmdir '/tmp/read_only'
+ end
+
+ data "/tmp/read_only"
test "report the error back to the user" do
- assert_match %r{Please ensure / is writable by the geminabox web server.}, geminabox_push(gem_file(:example))
+ assert_match %r{Please ensure /tmp/read_only is writable by the geminabox web server.}, geminabox_push(gem_file(:example))
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.