Skip to content
Permalink
Browse files

Readd spec for #1067

  • Loading branch information...
ddfreyne committed Jan 19, 2017
1 parent 1459b25 commit 4fc1c840850563f78266dfe96e427c2d156d8449
Showing with 34 additions and 0 deletions.
  1. +34 −0 spec/nanoc/regressions/gh_1067_spec.rb
@@ -0,0 +1,34 @@
describe 'GH-1067', site: true, stdio: true do
before do
File.write('nanoc.yaml', <<EOS)
environments:
default:
build: dev
prod:
build: prod
EOS

File.write('content/foo.erb', 'build=<%= @config[:build] %>')

File.write('Rules', <<EOS)
compile '/*' do
filter :erb
write item.identifier
end
EOS
end

it 'recompiles when env changes' do
ENV['NANOC_ENV'] = nil
Nanoc::CLI.run(%w(compile))
expect(File.read('output/foo.erb')).to eql('build=dev')

ENV['NANOC_ENV'] = nil
Nanoc::CLI.run(%w(compile -e prod))
expect(File.read('output/foo.erb')).to eql('build=prod')

ENV['NANOC_ENV'] = nil
Nanoc::CLI.run(%w(compile))
expect(File.read('output/foo.erb')).to eql('build=dev')
end
end

0 comments on commit 4fc1c84

Please sign in to comment.
You can’t perform that action at this time.