-
Notifications
You must be signed in to change notification settings - Fork 32
/
generate-with-erb.feature
47 lines (42 loc) · 1.95 KB
/
generate-with-erb.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Feature: Slides with ERB
reveal-ck can create a presentation using HTML and ERB.
You should create a file named `slides.html.erb` where each slide is
contained with a `<section>`. Then run `reveal-ck generate`.
Your slides will be available at `slides/index.html`.
If you'd like to see the intermediate file where your
`slides.html.erb` is transformed into `.html` you can visit
`slides/slides.html`
Scenario: Generating basic slides using html
Given a file named "slides.html.erb" with:
"""
<section>
<h1>Reveal.js</h1>
<h3>HTML Presentations Made Easy</h3>
</section>
<% ['Fancy', 'Cats'].each do |word| %>
<section>
<h1><%= word %></h1>
</section>
<% end %>
<section>
<h1>THE END</h1>
</section>
"""
When I run `reveal-ck generate`
Then the exit status should be 0
And the output should contain exactly "Generating slides for 'slides.html.erb'..\n"
And the following files should exist:
| slides/slides.html |
| slides/index.html |
And the file "slides/slides.html" should have html matching the xpath:
| //section/h1[text()="Reveal.js"] | the opening h1 |
| //section/h3[text()="HTML Presentations Made Easy"] | the opening h3 |
| //section/h1[text()="Fancy"] | the evaluated erb |
| //section/h1[text()="Cats"] | the evaluated erb |
| //section/h1[text()="THE END"] | the closing h1 |
And the file "slides/index.html" should have html matching the xpath:
| //section/h1[text()="Reveal.js"] | the opening h1 |
| //section/h3[text()="HTML Presentations Made Easy"] | the opening h3 |
| //section/h1[text()="Fancy"] | the evaluated erb |
| //section/h1[text()="Cats"] | the evaluated erb |
| //section/h1[text()="THE END"] | the closing h1 |