Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #69 from dlindahl/master

Fixed failing UnwritableDataDir test
  • Loading branch information...
commit 59d573d7a0c79ce05572b9cd52f38249e09242a2 2 parents f931829 + f717195
@cwninja cwninja authored
View
2  lib/geminabox.rb
@@ -83,8 +83,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.