From d9088f577af04393dc7960b2fda32d85581fb092 Mon Sep 17 00:00:00 2001 From: Bodo Tasche Date: Sun, 4 Dec 2016 19:05:33 +0100 Subject: [PATCH] [#37] Flaky test because of running order of tests (#38) fixes #37 --- spec/manpages/install_spec.rb | 5 ++++- spec/manpages/uninstall_spec.rb | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/manpages/install_spec.rb b/spec/manpages/install_spec.rb index 910c325..ac7ff5b 100644 --- a/spec/manpages/install_spec.rb +++ b/spec/manpages/install_spec.rb @@ -1,6 +1,10 @@ require "fileutils" describe Manpages::Install do + after do + FileUtils.rm_r "spec/tmp" + end + it "copies the man pages to a correct directory structure" do Manpages::Install.new( Gem::Specification.new(name: "manpages_test"), @@ -73,6 +77,5 @@ "Problems creating symlink spec/tmp/man/man2/example.2\n" \ "Problems creating symlink spec/tmp/man/man1/extra.1\n" ).to_stdout - FileUtils.rm_r "spec/tmp" end end diff --git a/spec/manpages/uninstall_spec.rb b/spec/manpages/uninstall_spec.rb index dcbcea6..46759d1 100644 --- a/spec/manpages/uninstall_spec.rb +++ b/spec/manpages/uninstall_spec.rb @@ -5,6 +5,10 @@ FileUtils.mkdir_p("spec/tmp/man/man1") end + after do + FileUtils.rm_r "spec/tmp" + end + it "Deletes a manpage if the link is to this gem" do FileUtils.ln_s("spec/data/man/example.1", "spec/tmp/man/man1/example.1") Manpages::Uninstall.new(