Skip to content

Commit

Permalink
Let show-data run preprocessor
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdefreyne committed Jun 18, 2016
1 parent fb3ae77 commit b422892
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/nanoc/cli/commands/show-data.rb
Expand Up @@ -9,7 +9,7 @@
module Nanoc::CLI::Commands
class ShowData < ::Nanoc::CLI::CommandRunner
def run
load_site
load_site(preprocess: true)

# Get data
items = site.items
Expand Down
15 changes: 15 additions & 0 deletions spec/nanoc/regressions/gh_867_spec.rb
@@ -0,0 +1,15 @@
describe 'GH-867', site: true, stdio: true do
before do
File.write('content/foo.md', 'stuff')

File.write('Rules', <<EOS)
preprocess do
items.delete_if { |_| true }
end
EOS
end

it 'preprocesses before running show-data' do
expect { Nanoc::CLI.run(%w( show-data )) }.not_to output(/foo/).to_stdout
end
end

0 comments on commit b422892

Please sign in to comment.