Skip to content

Commit 3fcc736

Browse files
committed
Update test suite, add Gemfile, add Circle config
1 parent 277a2a7 commit 3fcc736

File tree

8 files changed

+42
-17
lines changed

8 files changed

+42
-17
lines changed

.circleci/config.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
jobs:
3+
test:
4+
working_directory: ~/html2confluence
5+
docker:
6+
- image: circleci/ruby:2.5
7+
environment:
8+
GEM_HOME: ~/html2confluence/vendor/bundle
9+
steps:
10+
- checkout
11+
- run:
12+
name: Bundle
13+
command: bundle install --jobs=4 --retry=3
14+
- run:
15+
name: RSpec
16+
command: bundle exec rspec
17+
18+
workflows:
19+
version: 2
20+
test:
21+
jobs:
22+
- test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Gemfile.lock

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source 'https://rubygems.org'
2+
3+
gemspec

README.mdown renamed to README.md

File renamed without changes.

html2confluence.gemspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ Gem::Specification.new do |s|
1515
s.files = Dir.glob("{lib,spec}/**/*") + %w(example.rb README.mdown)
1616

1717
s.add_dependency "nokogiri"
18+
19+
s.add_development_dependency "rspec"
1820
end

spec/combination_examples_spec.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
require 'html2confluence'
44

55
describe HTMLToConfluenceParser, "when running combination examples" do
6-
76
it "should match complex examples" do
87
html = <<-END
98
<ol>
@@ -106,7 +105,13 @@
106105
END
107106

108107
markup = <<-END
109-
{quote}\nbq. content here\n{quote}
108+
{quote}
109+
110+
{quote}
111+
content here
112+
{quote}
113+
114+
{quote}
110115
END
111116

112117
parser = HTMLToConfluenceParser.new
@@ -207,9 +212,5 @@
207212
parser = HTMLToConfluenceParser.new
208213
parser.feed(html)
209214
expect(parser.to_wiki_markup.strip).to eq(markup)
210-
end
211-
215+
end
212216
end
213-
214-
215-

spec/complex_tables_spec.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
require 'html2confluence'
44

55
describe HTMLToConfluenceParser, "when running complex tables examples" do
6-
76
it "should handle table with newlines" do
87
html = <<-END
98
<table class="mce-item-table"><tbody><tr><td>As a...</td><td>I would like...</td><td>Because...</td></tr><tr><td><p>Student<br>or</p><p>Teacher</p></td><td>There to be more candy</td><td><p>Candy is:</p><ul><li>Delicious</li><li>Shiny</li><li>Good for my teeth</li></ul></td></tr></tbody></table>
@@ -83,8 +82,4 @@
8382
parser.feed(html)
8483
expect(parser.to_wiki_markup.strip).to include(markup.strip)
8584
end
86-
8785
end
88-
89-
90-

spec/jira_examples_spec.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
require 'html2confluence'
44

55
describe HTMLToConfluenceParser, "when running JIRA examples" do
6-
76
before :all do
87
html = <<-END
98
<h1><a name="Biggestheading"></a>Biggest heading</h1>
@@ -147,7 +146,10 @@
147146
^superscript^
148147
~subscript~
149148
{{monospaced}}
150-
bq. Some block quoted text
149+
150+
{quote}
151+
Some block quoted text
152+
{quote}
151153
152154
{quote}
153155
here is quotable
@@ -264,7 +266,7 @@
264266
end
265267

266268
it "should convert block quotes" do
267-
expect(@textile).to match(/^bq. Some block quoted text/)
269+
expect(@textile).to match(/^{quote}\nSome block quoted text\n{quote}/)
268270
expect(@textile).to match(/^\{quote\}\s*here is quotable\s*content to be quoted\s*{quote}/)
269271
end
270272

@@ -311,6 +313,5 @@
311313
expect(@textile).to include("(!)")
312314
expect(@textile).to include("(off)")
313315
expect(@textile).to include("(/)")
314-
end
315-
316+
end
316317
end

0 commit comments

Comments
 (0)