summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-05-12 14:20:18 -0500
committerSamuel Giddins <segiddins@segiddins.me>2017-05-12 14:20:18 -0500
commit4fcce0f3ed99de5d19ccbeaa47c94fb14fc7a29f (patch)
tree5def421efe3bfa15652b87f6b56fdea46cbcd8c8 /spec
parent9f4fa5f12e05899bb4c5ba19da353de6b47ccc33 (diff)
downloadbundler-4fcce0f3ed99de5d19ccbeaa47c94fb14fc7a29f.tar.gz
Ensure that manpages are always built when running specs
Diffstat (limited to 'spec')
-rw-r--r--spec/spec_helper.rb1
-rw-r--r--spec/support/manpages.rb13
2 files changed, 14 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 297d81f531..0a6b696fe7 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -40,6 +40,7 @@ end
$debug = false
+Spec::Manpages.setup
Spec::Rubygems.setup
FileUtils.rm_rf(Spec::Path.gem_repo1)
ENV["RUBYOPT"] = "#{ENV["RUBYOPT"]} -r#{Spec::Path.root}/spec/support/hax.rb"
diff --git a/spec/support/manpages.rb b/spec/support/manpages.rb
new file mode 100644
index 0000000000..e3031ca4a4
--- /dev/null
+++ b/spec/support/manpages.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+module Spec
+ module Manpages
+ def self.setup
+ man_path = Spec::Path.root.join("man")
+ return if man_path.children(false).select {|file| file.extname == ".ronn" }.all? do |man|
+ man_path.join(man).sub_ext(".txt").file?
+ end
+
+ system(Spec::Path.root.join("bin", "rake").to_s, "man:build") || raise("Failed building man pages")
+ end
+ end
+end