Skip to content
Browse files

added sample feature

  • Loading branch information...
1 parent ebfce56 commit f70b231755c2649c2cf2cbe96cb7b573a38d0e19 @inukshuk inukshuk committed
View
43 features/condition/number_is_numeric.feature
@@ -0,0 +1,43 @@
+Feature: Condition - Number Is Numeric
+
+ @v1.0 @std @citation
+ Scenario: Number Is Numeric
+ Given following style:
+ """
+ <style
+ xmlns="http://purl.org/net/xbiblio/csl"
+ class="note"
+ version="1.0">
+ <info>
+ <id />
+ <title />
+ <updated>2009-08-10T04:49:00+09:00</updated>
+ </info>
+ <citation>
+ <layout>
+ <choose>
+ <if is-numeric="edition">
+ <text value="TRUE"/>
+ </if>
+ <else>
+ <text value="FALSE"/>
+ </else>
+ </choose>
+ </layout>
+ </citation>
+ </style>
+ """
+ When I process the following items:
+ """
+ [
+ {
+ "edition": 5,
+ "id": "ITEM-1",
+ "type": "book"
+ }
+ ]
+ """
+ Then the result should be:
+ """
+ TRUE
+ """
View
19 features/step_definitions/citeproc_steps.rb
@@ -0,0 +1,19 @@
+
+Given /^(?:the )?following style:?$/ do |style|
+ @options[:style] = style
+end
+
+When /^I process the following items:$/ do |items|
+ processor = CiteProc::Processor.new(@options)
+ MultiJson.decode(items, :symbolize_keys => true).each do |item|
+ processor.items[item[:id].to_sym] = item
+ end
+
+ processor.engine.update_items(items.map { |i| i[:id].to_sym })
+ @result = processor.bibliography
+ # @result = processor.engine.process(items.map { |i| i[:id] })
+end
+
+Then /^the result should be:$/ do |expected|
+ @result.should == expected
+end
View
5 features/support/hooks.rb
@@ -0,0 +1,5 @@
+
+Before do
+ @options = {}
+ @options[:engine] = 'citeproc-js'
+end

0 comments on commit f70b231

Please sign in to comment.
Something went wrong with that request. Please try again.