test/test_post.rb in hawkins-2.0.2 vs test/test_post.rb in hawkins-2.0.3
- old
+ new
@@ -35,10 +35,11 @@
# Look at http://betterspecs.org for ideas.
it 'uses a provided date' do
title = "1999"
expected_body = <<-BODY.gsub(/^\s*/, '')
---
+ layout: post
title: #{title}
---
BODY
expected_file = build_expected_path("1999-12-31", title)
@@ -58,10 +59,11 @@
it 'uses today as the default date' do
title = "Raspberry Beret"
expected_body = <<-BODY.gsub(/^\s*/, '')
---
+ layout: post
title: #{title}
---
BODY
expected_file = build_expected_path(date, title)
@@ -150,10 +152,10 @@
allow(File).to receive(:open).with(/#{expected_file}/, 'w').and_yield(file)
expect(file).to receive(:write).twice
%w(xemacs emacs).each do |editor|
allow(Commands::Post).to receive(:exec)
- .with(editor, '+3', /#{expected_file}/)
+ .with(editor, '+4', /#{expected_file}/)
.and_return(nil)
stub_const("ENV", ENV.to_h.tap { |h| h['VISUAL'] = editor })
expect do
Commands::Post.create([title], {})
end.to output(/Wrote/).to_stdout