From da81bbb33a483d07c11cf06ddbe1e6bc347147f0 Mon Sep 17 00:00:00 2001 From: Sylvester Keil Date: Sun, 10 May 2015 19:52:05 +0200 Subject: [PATCH] ensure months are parsed to symbols see #82 --- features/details.feature | 24 ++++++++++++++++++++++ features/step_definitions/scholar_steps.rb | 8 ++++++++ 2 files changed, 32 insertions(+) diff --git a/features/details.feature b/features/details.feature index 8ff1b76..a184d0c 100644 --- a/features/details.feature +++ b/features/details.feature @@ -184,3 +184,27 @@ Feature: Details And the "_site/scholar/index.html" file should exist And I should see "]+href=\"/bibliography/ruby/index.html\">" in "_site/scholar/index.html" And the "_site/bibliography/ruby/index.html" file should exist + + @generators @parse_months @wip + Scenario: Months are parsed by default + Given I have a scholar configuration with: + | key | value | + | details_layout | details.html | + And I have a "_bibliography" directory + And I have a file "_bibliography/references.bib": + """ + @book{august, + month = {August} + } + """ + And I have a "_layouts" directory + And I have a file "_layouts/details.html": + """ + --- + --- + {{ page.entry.bibtex }} + """ + When I run jekyll + Then the _site directory should exist + And the "_site/bibliography/august.html" file should exist + And I should see "month = aug" in "_site/bibliography/august.html" diff --git a/features/step_definitions/scholar_steps.rb b/features/step_definitions/scholar_steps.rb index 059fa56..32046e9 100644 --- a/features/step_definitions/scholar_steps.rb +++ b/features/step_definitions/scholar_steps.rb @@ -18,6 +18,14 @@ Given(/^I have a scholar configuration with:$/) do |table| end end +Given(/^I have the following BibTeX options:$/) do |table| + File.open('_config.yml', 'a') do |f| + f.write(" bibtex_options:\n") + table.hashes.each do |row| + f.write(" #{row["key"]}: #{row["value"]}\n") + end + end +end Then(/^"(.*)" should come before "(.*)" in "(.*)"$/) do |p1, p2, file| data = File.open(file).readlines.join('') -- GitLab