Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Using mkdir_p instead of mkdir

  • Loading branch information...
commit f8cbb07e614be0724f3a3fed0ba66ef92ee0c51a 1 parent 2b33099
@qrush qrush authored
Showing with 5 additions and 5 deletions.
  1. +2 −2 lib/pythagoras/runner.rb
  2. +3 −3 test/runner_test.rb
View
4 lib/pythagoras/runner.rb
@@ -77,7 +77,7 @@ def score
if File.exist?(self.scores_path)
@old_scores = YAML.load_file(self.scores_path)
else
- FileUtils.mkdir(File.dirname(self.scores_path))
+ FileUtils.mkdir_p(File.dirname(self.scores_path))
@old_scores = {}
end
@@ -90,7 +90,7 @@ def archive
if File.exist?(self.archive_path)
archive = YAML.load_file(archive_path)
else
- FileUtils.mkdir(File.dirname(self.archive_path))
+ FileUtils.mkdir_p(File.dirname(self.archive_path))
archive = {}
end
View
6 test/runner_test.rb
@@ -162,7 +162,7 @@ class RunnerTest < Test::Unit::TestCase
@report = YAML.load_file(File.expand_path(File.join(__FILE__, "..", "fixtures", "report.yml")))
stub(YAML).load_file(File.join(MetricFu.base_directory, "report.yml")) { @report }
stub(File).exist?(anything) { false }
- stub(FileUtils).mkdir(anything)
+ stub(FileUtils).mkdir_p(anything)
stub(File).open(@runner.scores_path, "w")
end
@@ -177,7 +177,7 @@ class RunnerTest < Test::Unit::TestCase
should "set old score if it's not there" do
mock(File).exist?(@runner.scores_path) { false }
- mock(FileUtils).mkdir(File.dirname(@runner.scores_path))
+ mock(FileUtils).mkdir_p(File.dirname(@runner.scores_path))
@runner.score
assert_equal Hash.new, @runner.old_scores
@@ -240,7 +240,7 @@ class RunnerTest < Test::Unit::TestCase
mock(File).exist?(@runner.archive_path) { false }
mock(YAML).load_file(anything).never
- mock(FileUtils).mkdir(File.dirname(@runner.archive_path))
+ mock(FileUtils).mkdir_p(File.dirname(@runner.archive_path))
mock(File).open(@runner.archive_path, "w")
@runner.archive
Please sign in to comment.
Something went wrong with that request. Please try again.