Add test for creation of Gemfile by 'jekyll new'

This commit is contained in:
Parker Moore 2016-03-23 17:24:33 -07:00
parent 09f9f193d8
commit da35e134f1
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
1 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,15 @@ class TestNewCommand < JekyllUnitTest
assert_exist @full_path
end
should "create a Gemfile" do
gemfile = File.join(@full_path, "Gemfile")
refute_exist @full_path
capture_stdout { Jekyll::Commands::New.process(@args) }
assert_exist gemfile
assert_match /gem "jekyll", "#{Jekyll::VERSION}"/, File.read(gemfile)
assert_match /gem "github-pages"/, File.read(gemfile)
end
should 'display a success message' do
Jekyll::Commands::New.process(@args)
output = Jekyll.logger.messages.last
@ -40,6 +49,7 @@ class TestNewCommand < JekyllUnitTest
static_template_files = dir_contents(site_template).reject do |f|
File.extname(f) == '.erb'
end
static_template_files << "/Gemfile"
capture_stdout { Jekyll::Commands::New.process(@args) }