Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spec/coverage
4 changes: 3 additions & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
--color
--colour
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🇨🇦 🇬🇧 🇳🇿

--require spec_helper
--profile
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
60 changes: 60 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
PATH
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think lockfiles should be included in gems: could we ignore this? They should be testable with whatever is the latest.

remote: .
specs:
html2confluence (1.3.23)
nokogiri

GEM
remote: https://rubygems.org/
specs:
ast (2.4.0)
diff-lcs (1.3)
docile (1.3.1)
json (2.1.0)
mini_portile2 (2.3.0)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
parallel (1.12.1)
parser (2.5.1.2)
ast (~> 2.4.0)
powerpack (0.1.2)
rainbow (3.0.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubocop (0.55.0)
parallel (~> 1.10)
parser (>= 2.5)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.10.0)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
unicode-display_width (1.4.0)

PLATFORMS
ruby

DEPENDENCIES
html2confluence!
rspec
rubocop (< 0.56)
simplecov

BUNDLED WITH
1.16.6
3 changes: 3 additions & 0 deletions html2confluence.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ Gem::Specification.new do |s|
s.files = Dir.glob("{lib,spec}/**/*") + %w(example.rb README.mdown)

s.add_dependency "nokogiri"
s.add_development_dependency "rspec"
s.add_development_dependency "rubocop", "< 0.56"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be pinned down?

s.add_development_dependency "simplecov"
end
16 changes: 2 additions & 14 deletions spec/combination_examples_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# encoding: utf-8
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
require 'html2confluence'

describe HTMLToConfluenceParser, "when running combination examples" do
let(:parser) { HTMLToConfluenceParser.new }

it "should match complex examples" do
html = <<-END
Expand All @@ -20,7 +19,6 @@
END


parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to include(markup.strip)
end
Expand Down Expand Up @@ -95,7 +93,6 @@
h1. With +nice+ formatting.
END

parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to include(markup.strip)
end
Expand All @@ -106,10 +103,9 @@
END

markup = <<-END
{quote}\nbq. content here\n{quote}
{quote}\ncontent here\n{quote}
END

parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to include(markup.strip)
end
Expand All @@ -122,7 +118,6 @@

markup = "Previous\n\n*Scenario 4a: Existing deletes their ID*\n*Given* I am an existing user"

parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to eq(markup)
end
Expand All @@ -136,7 +131,6 @@

markup = "Previous line\n\n*Scenario 4a: Existing deletes their ID*\n*Given* I am an existing user"

parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to eq(markup)
end
Expand All @@ -146,7 +140,6 @@

markup = "*And* first line\n\n*second line*"

parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to eq(markup)
end
Expand All @@ -156,7 +149,6 @@

markup = "!a source!"

parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to eq(markup)
end
Expand All @@ -165,7 +157,6 @@
html = "<div>familiar with the XML<wbr>Http<wbr>Request Object</div>\n\n"

markup = "familiar with the XMLHttpRequest Object"
parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to eq(markup)

Expand All @@ -179,7 +170,6 @@

markup = "Previous line\n\n----"

parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to eq(markup)
end
Expand All @@ -191,7 +181,6 @@

markup = "A"

parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to eq(markup)
end
Expand All @@ -204,7 +193,6 @@

markup = "A"

parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to eq(markup)
end
Expand Down
7 changes: 1 addition & 6 deletions spec/complex_tables_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# encoding: utf-8
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
require 'html2confluence'

describe HTMLToConfluenceParser, "when running complex tables examples" do
let(:parser) { HTMLToConfluenceParser.new }

it "should handle table with newlines" do
html = <<-END
Expand All @@ -21,7 +20,6 @@
* Good for my teeth|
END

parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to include(markup.strip)
end
Expand All @@ -35,7 +33,6 @@
| |Empty| |
END

parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to include(markup.strip)
end
Expand All @@ -52,7 +49,6 @@
b{noformat} |c |
END

parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to include(markup.strip)
end
Expand All @@ -79,7 +75,6 @@
2{noformat} |3 |
END

parser = HTMLToConfluenceParser.new
parser.feed(html)
expect(parser.to_wiki_markup.strip).to include(markup.strip)
end
Expand Down
10 changes: 3 additions & 7 deletions spec/html2confluence_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# encoding: utf-8
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
require 'html2confluence'

describe HTMLToConfluenceParser, "when converting html to textile" do
let(:parser) { HTMLToConfluenceParser.new }

context "in a large html document" do
before :all do
before do
html = <<-END
<div>

Expand Down Expand Up @@ -126,7 +126,6 @@
|Not table
</div>
END
parser = HTMLToConfluenceParser.new
parser.feed(html)
@textile = parser.to_wiki_markup
end
Expand Down Expand Up @@ -265,7 +264,6 @@
</blockquote>
END

parser = HTMLToConfluenceParser.new
parser.feed(html)
@textile = parser.to_wiki_markup

Expand All @@ -284,7 +282,6 @@
</blockquote>
END

parser = HTMLToConfluenceParser.new
parser.feed(html)
@textile = parser.to_wiki_markup

Expand All @@ -303,7 +300,6 @@
</blockquote>
END

parser = HTMLToConfluenceParser.new
parser.feed(html)
@textile = parser.to_wiki_markup

Expand Down
Loading