caramelize 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +30 -0
  3. data/.github/dependabot.yml +1 -1
  4. data/.github/workflows/main.yml +4 -4
  5. data/.ruby-version +1 -0
  6. data/Gemfile +6 -11
  7. data/Gemfile.lock +85 -90
  8. data/LICENSE.md +1 -1
  9. data/Rakefile +3 -3
  10. data/caramelize.gemspec +24 -20
  11. data/lib/caramelize/caramel.rb +23 -23
  12. data/lib/caramelize/content_transferer.rb +18 -18
  13. data/lib/caramelize/database_connector.rb +6 -6
  14. data/lib/caramelize/filters/camel_case_to_wiki_links.rb +2 -2
  15. data/lib/caramelize/filters/mediawiki_to_markdown.rb +4 -4
  16. data/lib/caramelize/filters/swap_wiki_links.rb +2 -2
  17. data/lib/caramelize/filters/wikka_to_markdown.rb +2 -2
  18. data/lib/caramelize/health_check.rb +1 -1
  19. data/lib/caramelize/health_checks/home_page_check.rb +2 -2
  20. data/lib/caramelize/health_checks/orphaned_pages_check.rb +1 -1
  21. data/lib/caramelize/health_checks/page.rb +2 -2
  22. data/lib/caramelize/input_wiki/media_wiki.rb +17 -17
  23. data/lib/caramelize/input_wiki/redmine_wiki.rb +23 -23
  24. data/lib/caramelize/input_wiki/wiki.rb +1 -1
  25. data/lib/caramelize/input_wiki/wikka_wiki.rb +15 -15
  26. data/lib/caramelize/output_wiki/gollum.rb +3 -3
  27. data/lib/caramelize/page.rb +11 -11
  28. data/lib/caramelize/services/page_builder.rb +4 -4
  29. data/lib/caramelize/version.rb +1 -1
  30. data/lib/caramelize.rb +16 -16
  31. data/samples/media_wiki.rb +4 -4
  32. data/spec/lib/caramelize/content_transferer_spec.rb +4 -4
  33. data/spec/lib/caramelize/filter_processor_spec.rb +7 -7
  34. data/spec/lib/caramelize/filters/add_newline_to_page_end_spec.rb +7 -7
  35. data/spec/lib/caramelize/filters/camel_case_to_wiki_links_spec.rb +17 -19
  36. data/spec/lib/caramelize/filters/mediawiki_to_markdown_spec.rb +4 -4
  37. data/spec/lib/caramelize/filters/remove_table_tab_line_endings_spec.rb +15 -17
  38. data/spec/lib/caramelize/filters/swap_wiki_links_spec.rb +23 -25
  39. data/spec/lib/caramelize/filters/wikka_to_markdown_spec.rb +82 -84
  40. data/spec/lib/caramelize/input_wiki/media_wiki_spec.rb +3 -3
  41. data/spec/lib/caramelize/input_wiki/wiki_spec.rb +21 -21
  42. data/spec/lib/caramelize/input_wiki/wikka_wiki_spec.rb +3 -3
  43. data/spec/lib/caramelize/output_wiki/gollum_spec.rb +39 -39
  44. data/spec/lib/caramelize/page_spec.rb +30 -30
  45. data/spec/lib/caramelize/services/page_builder_spec.rb +12 -12
  46. data/spec/spec_helper.rb +2 -3
  47. metadata +62 -9
  48. data/.rubocop.yml +0 -31
  49. data/.rubocop_todo.yml +0 -55
@@ -1,24 +1,24 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Caramelize::MediawikiToMarkdown do
6
6
  let(:filter) { described_class.new(body) }
7
7
 
8
- describe '#run' do
8
+ describe "#run" do
9
9
  subject { filter.run }
10
10
 
11
11
  # the conversions are performed through pandoc-ruby.
12
12
  # This is a smoke test to see if it's called at all,
13
13
  # but not testing every single option.
14
14
 
15
- context 'when headline h1' do
15
+ context "when headline h1" do
16
16
  let(:body) { "= Headline =\n" }
17
17
 
18
18
  it { is_expected.to eq "# Headline\n" }
19
19
  end
20
20
 
21
- context 'when headline h2' do
21
+ context "when headline h2" do
22
22
  let(:body) { "== Headline ==\n" }
23
23
 
24
24
  it { is_expected.to eq "## Headline\n" }
@@ -1,54 +1,52 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
- # rubocop:todo RSpec/SpecFilePathFormat
6
- describe Caramelize::RemoveTableTabLineEndings do # rubocop:todo RSpec/FilePath, RSpec/SpecFilePathFormat
7
- # rubocop:enable RSpec/SpecFilePathFormat
5
+ describe Caramelize::RemoveTableTabLineEndings do # rubocop:todo RSpec/SpecFilePathFormat
8
6
  subject(:run) { filter.run }
9
7
 
10
8
  let(:filter) { described_class.new(body) }
11
9
 
12
- describe '#run' do
13
- context 'table with tabs at unix line-endings' do # rubocop:todo RSpec/ContextWording
10
+ describe "#run" do
11
+ context "table with tabs at unix line-endings" do # rubocop:todo RSpec/ContextWording
14
12
  let(:body) { "cell1\t|cell2\t|\t\t\n" }
15
13
 
16
- it 'removes tabs at end of line' do
14
+ it "removes tabs at end of line" do
17
15
  expect(run).to eq "cell1\t|cell2\t|\n"
18
16
  end
19
17
  end
20
18
 
21
- context 'with spaces on line ending' do
19
+ context "with spaces on line ending" do
22
20
  let(:body) { "cell1\t|cell2\t|\t \n" }
23
21
 
24
- it 'removes spaces at end of line' do
22
+ it "removes spaces at end of line" do
25
23
  expect(run).to eq "cell1\t|cell2\t|\n"
26
24
  end
27
25
 
28
- context 'replace in full file' do # rubocop:todo RSpec/ContextWording
26
+ context "replace in full file" do # rubocop:todo RSpec/ContextWording
29
27
  let(:body) do
30
- File.read(File.join(['spec', 'fixtures', 'markup', 'table-tab-line-endings-input.textile']))
28
+ File.read(File.join(["spec", "fixtures", "markup", "table-tab-line-endings-input.textile"]))
31
29
  end
32
30
 
33
- it 'returns as expected' do
34
- output_text = File.read(File.join(['spec', 'fixtures', 'markup', 'table-tab-line-endings-output.textile']))
31
+ it "returns as expected" do
32
+ output_text = File.read(File.join(["spec", "fixtures", "markup", "table-tab-line-endings-output.textile"]))
35
33
  expect(run).to eq output_text
36
34
  end
37
35
  end
38
36
  end
39
37
 
40
- context 'with table having tabs at windows line-endings' do
38
+ context "with table having tabs at windows line-endings" do
41
39
  let(:body) { "cell1\t|cell2\t|\t\t\r\n" }
42
40
 
43
- it 'removes tabs at end of line' do
41
+ it "removes tabs at end of line" do
44
42
  expect(run).to eq "cell1\t|cell2\t|\n"
45
43
  end
46
44
  end
47
45
 
48
- context 'with spaces and windows line-endings' do
46
+ context "with spaces and windows line-endings" do
49
47
  let(:body) { "cell1\t|cell2\t|\t \r\n" }
50
48
 
51
- it 'removes spaces at end of line' do
49
+ it "removes spaces at end of line" do
52
50
  expect(run).to eq "cell1\t|cell2\t|\n"
53
51
  end
54
52
  end
@@ -1,51 +1,49 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
- # rubocop:todo RSpec/SpecFilePathFormat
6
- describe Caramelize::SwapWikiLinks do # rubocop:todo RSpec/FilePath, RSpec/SpecFilePathFormat
7
- # rubocop:enable RSpec/SpecFilePathFormat
8
- describe '#run' do
5
+ describe Caramelize::SwapWikiLinks do # rubocop:todo RSpec/SpecFilePathFormat
6
+ describe "#run" do
9
7
  subject(:run) { filter.run }
10
8
 
11
9
  let(:filter) { described_class.new(body) }
12
10
 
13
- context 'with wiki link with title' do
14
- let(:body) { '[[statistics|Driver & Team Statistics]]' }
11
+ context "with wiki link with title" do
12
+ let(:body) { "[[statistics|Driver & Team Statistics]]" }
15
13
 
16
- it 'swaps title and target' do
17
- expect(run).to eq '[[Driver & Team Statistics|statistics]]'
14
+ it "swaps title and target" do
15
+ expect(run).to eq "[[Driver & Team Statistics|statistics]]"
18
16
  end
19
17
  end
20
18
 
21
- context 'with wiki title with spaces' do
22
- let(:body) { '[[Release 1 0]]' }
19
+ context "with wiki title with spaces" do
20
+ let(:body) { "[[Release 1 0]]" }
23
21
 
24
- it 'replaces space with dashes' do
25
- expect(run).to eq '[[Release 1 0|release_1_0]]'
22
+ it "replaces space with dashes" do
23
+ expect(run).to eq "[[Release 1 0|release_1_0]]"
26
24
  end
27
25
  end
28
26
 
29
- context 'with wiki title with dashes' do
30
- let(:body) { '[[Release-1.0]]' }
27
+ context "with wiki title with dashes" do
28
+ let(:body) { "[[Release-1.0]]" }
31
29
 
32
- it 'removes dots' do
33
- expect(run).to eq '[[Release-1.0|release-10]]'
30
+ it "removes dots" do
31
+ expect(run).to eq "[[Release-1.0|release-10]]"
34
32
  end
35
33
  end
36
34
 
37
- context 'with wiki link with spaces and without title' do
38
- let(:body) { '[[Intra wiki link]]' }
35
+ context "with wiki link with spaces and without title" do
36
+ let(:body) { "[[Intra wiki link]]" }
39
37
 
40
- it 'simples link to hyperlink' do
41
- expect(run).to eq '[[Intra wiki link|intra_wiki_link]]'
38
+ it "simples link to hyperlink" do
39
+ expect(run).to eq "[[Intra wiki link|intra_wiki_link]]"
42
40
  end
43
41
 
44
- context 'with replace in full file' do
45
- let(:body) { File.read(File.join(['spec', 'fixtures', 'markup', 'swap-links-input.textile'])) }
42
+ context "with replace in full file" do
43
+ let(:body) { File.read(File.join(["spec", "fixtures", "markup", "swap-links-input.textile"])) }
46
44
 
47
- it 'returns as expected' do
48
- output_text = File.read(File.join(['spec', 'fixtures', 'markup', 'swap-links-output.textile']))
45
+ it "returns as expected" do
46
+ output_text = File.read(File.join(["spec", "fixtures", "markup", "swap-links-output.textile"]))
49
47
  expect(run).to eq output_text
50
48
  end
51
49
  end
@@ -1,168 +1,166 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
- # rubocop:todo RSpec/SpecFilePathFormat
6
- describe Caramelize::WikkaToMarkdown do # rubocop:todo RSpec/FilePath, RSpec/SpecFilePathFormat
7
- # rubocop:enable RSpec/SpecFilePathFormat
5
+ describe Caramelize::WikkaToMarkdown do # rubocop:todo RSpec/SpecFilePathFormat
8
6
  let(:filter) { described_class.new(body) }
9
7
 
10
- describe '#run' do
8
+ describe "#run" do
11
9
  subject { filter.run }
12
10
 
13
- xcontext 'when keep line breaks' do # rubocop:todo RSpec/PendingWithoutReason
11
+ xcontext "when keep line breaks" do # rubocop:todo RSpec/PendingWithoutReason
14
12
  let(:body) { "line1\nline2" }
15
13
 
16
14
  it { is_expected.to eq "line1 \nline2" }
17
15
  end
18
16
 
19
- context 'when headline h1' do
20
- let(:body) { '======Headline======' }
17
+ context "when headline h1" do
18
+ let(:body) { "======Headline======" }
21
19
 
22
- it { is_expected.to eq '# Headline' }
20
+ it { is_expected.to eq "# Headline" }
23
21
  end
24
22
 
25
- context 'when headline h2' do
26
- let(:body) { '=====Headline=====' }
23
+ context "when headline h2" do
24
+ let(:body) { "=====Headline=====" }
27
25
 
28
- it { is_expected.to eq '## Headline' }
26
+ it { is_expected.to eq "## Headline" }
29
27
  end
30
28
 
31
- context 'when headline h3' do
32
- let(:body) { '====Headline====' }
29
+ context "when headline h3" do
30
+ let(:body) { "====Headline====" }
33
31
 
34
- it { is_expected.to eq '### Headline' }
32
+ it { is_expected.to eq "### Headline" }
35
33
  end
36
34
 
37
- context 'when headline h4' do
38
- let(:body) { '===Headline===' }
35
+ context "when headline h4" do
36
+ let(:body) { "===Headline===" }
39
37
 
40
- it { is_expected.to eq '#### Headline' }
38
+ it { is_expected.to eq "#### Headline" }
41
39
  end
42
40
 
43
- context 'when headline h5' do
44
- let(:body) { '==Headline==' }
41
+ context "when headline h5" do
42
+ let(:body) { "==Headline==" }
45
43
 
46
- it { is_expected.to eq '##### Headline' }
44
+ it { is_expected.to eq "##### Headline" }
47
45
  end
48
46
 
49
- context 'when bold' do
50
- let(:body) { '**Text is bold**' }
47
+ context "when bold" do
48
+ let(:body) { "**Text is bold**" }
51
49
 
52
- it { is_expected.to eq '**Text is bold**' }
50
+ it { is_expected.to eq "**Text is bold**" }
53
51
  end
54
52
 
55
- context 'when italic' do
56
- let(:body) { '//Text is italic//' }
53
+ context "when italic" do
54
+ let(:body) { "//Text is italic//" }
57
55
 
58
- it { is_expected.to eq '*Text is italic*' }
56
+ it { is_expected.to eq "*Text is italic*" }
59
57
  end
60
58
 
61
- context 'when underline' do
62
- let(:body) { '__Text is underlined__' }
59
+ context "when underline" do
60
+ let(:body) { "__Text is underlined__" }
63
61
 
64
- it { is_expected.to eq '<u>Text is underlined</u>' }
62
+ it { is_expected.to eq "<u>Text is underlined</u>" }
65
63
  end
66
64
 
67
- context 'when line break' do
65
+ context "when line break" do
68
66
  let(:body) { 'Text is---\nbroken to two lines.' }
69
67
 
70
68
  it { is_expected.to eq 'Text is \nbroken to two lines.' }
71
69
  end
72
70
 
73
- context 'when unordered list entry' do
74
- context 'with tabs' do
71
+ context "when unordered list entry" do
72
+ context "with tabs" do
75
73
  let(:body) { "\t-unordered list entry" }
76
74
 
77
- it { is_expected.to eq '- unordered list entry' }
75
+ it { is_expected.to eq "- unordered list entry" }
78
76
  end
79
77
 
80
- context 'with tilde' do
81
- let(:body) { '~-unordered list entry' }
78
+ context "with tilde" do
79
+ let(:body) { "~-unordered list entry" }
82
80
 
83
- it { is_expected.to eq '- unordered list entry' }
81
+ it { is_expected.to eq "- unordered list entry" }
84
82
  end
85
83
 
86
- context 'with spaces' do
87
- let(:body) { ' - unordered list entry' }
84
+ context "with spaces" do
85
+ let(:body) { " - unordered list entry" }
88
86
 
89
- it { is_expected.to eq '- unordered list entry' }
87
+ it { is_expected.to eq "- unordered list entry" }
90
88
  end
91
89
  end
92
90
 
93
- context 'when ordered list entry' do
94
- context 'without space' do
95
- let(:body) { '~1)ordered list entry' }
91
+ context "when ordered list entry" do
92
+ context "without space" do
93
+ let(:body) { "~1)ordered list entry" }
96
94
 
97
- it { is_expected.to eq '1. ordered list entry' }
95
+ it { is_expected.to eq "1. ordered list entry" }
98
96
  end
99
97
 
100
- context 'with space' do
101
- let(:body) { '~1) ordered list entry' }
98
+ context "with space" do
99
+ let(:body) { "~1) ordered list entry" }
102
100
 
103
- it { is_expected.to eq '1. ordered list entry' }
101
+ it { is_expected.to eq "1. ordered list entry" }
104
102
  end
105
103
  end
106
104
 
107
- context 'when wikilink' do
108
- context 'with only url' do
109
- let(:body) { '[[LemmaLemma]]' }
105
+ context "when wikilink" do
106
+ context "with only url" do
107
+ let(:body) { "[[LemmaLemma]]" }
110
108
 
111
- it { is_expected.to eq '[[LemmaLemma]]' }
109
+ it { is_expected.to eq "[[LemmaLemma]]" }
112
110
  end
113
111
 
114
- context 'with only wikilink' do
112
+ context "with only wikilink" do
115
113
  let(:body) { "\n [[ComunitySiteIdeas]] \n" }
116
114
 
117
115
  it { is_expected.to eq "\n [[ComunitySiteIdeas]] \n" }
118
116
  end
119
117
 
120
- context 'with url and pipe title' do
121
- let(:body) { '[[SandBox|Test your formatting skills]]' }
118
+ context "with url and pipe title" do
119
+ let(:body) { "[[SandBox|Test your formatting skills]]" }
122
120
 
123
- it { is_expected.to eq '[[Test your formatting skills|SandBox]]' }
121
+ it { is_expected.to eq "[[Test your formatting skills|SandBox]]" }
124
122
  end
125
123
 
126
- context 'with url and title' do
127
- let(:body) { '[[SandBox Test your formatting skills]]' }
124
+ context "with url and title" do
125
+ let(:body) { "[[SandBox Test your formatting skills]]" }
128
126
 
129
- it { is_expected.to eq '[[Test your formatting skills|SandBox]]' }
127
+ it { is_expected.to eq "[[Test your formatting skills|SandBox]]" }
130
128
  end
131
129
  end
132
130
 
133
- context 'when hyperlink' do
134
- context 'with only url' do
135
- let(:body) { '[[http://target]]' }
131
+ context "when hyperlink" do
132
+ context "with only url" do
133
+ let(:body) { "[[http://target]]" }
136
134
 
137
- it { is_expected.to eq '<http://target>' }
135
+ it { is_expected.to eq "<http://target>" }
138
136
  end
139
137
 
140
- context 'with url with title' do
141
- let(:body) { '[[http://target Title]]' }
138
+ context "with url with title" do
139
+ let(:body) { "[[http://target Title]]" }
142
140
 
143
- it { is_expected.to eq '[Title](http://target)' }
141
+ it { is_expected.to eq "[Title](http://target)" }
144
142
  end
145
143
 
146
- context 'with url with title and special characters' do
147
- let(:body) { '- [[http://www.sourcepole.com/sources/programming/cpp/cppqref.html C++ Syntax Reference]]' }
144
+ context "with url with title and special characters" do
145
+ let(:body) { "- [[http://www.sourcepole.com/sources/programming/cpp/cppqref.html C++ Syntax Reference]]" }
148
146
 
149
- it { is_expected.to eq '- [C++ Syntax Reference](http://www.sourcepole.com/sources/programming/cpp/cppqref.html)' }
147
+ it { is_expected.to eq "- [C++ Syntax Reference](http://www.sourcepole.com/sources/programming/cpp/cppqref.html)" }
150
148
  end
151
149
 
152
- context 'with url with pipe' do
153
- let(:body) { '[[http://target|Title]]' }
150
+ context "with url with pipe" do
151
+ let(:body) { "[[http://target|Title]]" }
154
152
 
155
- it { is_expected.to eq '[Title](http://target)' }
153
+ it { is_expected.to eq "[Title](http://target)" }
156
154
  end
157
155
  end
158
156
 
159
- context 'when inline code' do
160
- let(:body) { 'Code: %%Hello World%% // done' }
157
+ context "when inline code" do
158
+ let(:body) { "Code: %%Hello World%% // done" }
161
159
 
162
- it { is_expected.to eq 'Code: `Hello World` // done' }
160
+ it { is_expected.to eq "Code: `Hello World` // done" }
163
161
  end
164
162
 
165
- context 'when code block' do
163
+ context "when code block" do
166
164
  let(:body) do
167
165
  <<~CPP
168
166
  Text before
@@ -203,7 +201,7 @@ describe Caramelize::WikkaToMarkdown do # rubocop:todo RSpec/FilePath, RSpec/Spe
203
201
  it { is_expected.to eq expected_result }
204
202
  end
205
203
 
206
- context 'when code block with language' do
204
+ context "when code block with language" do
207
205
  let(:body) do
208
206
  <<~CPP
209
207
  Text before
@@ -244,29 +242,29 @@ describe Caramelize::WikkaToMarkdown do # rubocop:todo RSpec/FilePath, RSpec/Spe
244
242
  it { is_expected.to eq expected_result }
245
243
  end
246
244
 
247
- context 'when image' do
248
- context 'with link' do
245
+ context "when image" do
246
+ context "with link" do
249
247
  let(:body) { '{{image class="center" alt="DVD logo" title="An image link" url="images/dvdvideo.gif" link="RecentChanges"}}' }
250
248
 
251
249
  it { is_expected.to eq '[[<img src="images/dvdvideo.gif" alt="DVD logo">|RecentChanges]]' }
252
250
  end
253
251
 
254
- context 'with alt and with title' do
252
+ context "with alt and with title" do
255
253
  let(:body) { '{{image class="center" alt="DVD logo" title="An image link" url="images/dvdvideo.gif"}}' }
256
254
 
257
- it { is_expected.to eq '![DVD logo](images/dvdvideo.gif)' }
255
+ it { is_expected.to eq "![DVD logo](images/dvdvideo.gif)" }
258
256
  end
259
257
 
260
- context 'without alt and with title' do
258
+ context "without alt and with title" do
261
259
  let(:body) { '{{image class="center" title="An image link" url="images/dvdvideo.gif"}}' }
262
260
 
263
- it { is_expected.to eq '![](images/dvdvideo.gif)' }
261
+ it { is_expected.to eq "![](images/dvdvideo.gif)" }
264
262
  end
265
263
 
266
- context 'without alt and without title' do
264
+ context "without alt and without title" do
267
265
  let(:body) { '{{image class="center" url="images/dvdvideo.gif"}}' }
268
266
 
269
- it { is_expected.to eq '![](images/dvdvideo.gif)' }
267
+ it { is_expected.to eq "![](images/dvdvideo.gif)" }
270
268
  end
271
269
  end
272
270
  end
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Caramelize::InputWiki::MediaWiki do
6
6
  subject(:wiki) { described_class.new }
7
7
 
8
- describe '#filters' do
9
- it 'has 2 filters' do
8
+ describe "#filters" do
9
+ it "has 2 filters" do
10
10
  expect(wiki.filters.count).to be(2)
11
11
  end
12
12
  end
@@ -1,56 +1,56 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Caramelize::InputWiki::Wiki do
6
6
  subject(:wiki) { described_class.new }
7
7
 
8
- describe '#latest_revisions' do
8
+ describe "#latest_revisions" do
9
9
  let(:page1) { double } # rubocop:todo RSpec/IndexedLet
10
10
  let(:page2) { double } # rubocop:todo RSpec/IndexedLet
11
11
  let(:page3) { double } # rubocop:todo RSpec/IndexedLet
12
12
 
13
- context 'without pages' do
14
- it 'return empty array' do
13
+ context "without pages" do
14
+ it "return empty array" do
15
15
  expect(wiki.latest_revisions).to eq []
16
16
  end
17
17
  end
18
18
 
19
- context 'with pages with revisions' do
20
- it 'returns list of latest pages' do # rubocop:todo RSpec/ExampleLength
19
+ context "with pages with revisions" do
20
+ it "returns list of latest pages" do # rubocop:todo RSpec/ExampleLength
21
21
  wiki.titles = %w[allosaurus brachiosaurus]
22
22
  allow(wiki).to receive(:revisions_by_title) # rubocop:todo RSpec/SubjectStub
23
- .with('allosaurus').and_return([page1, page2])
23
+ .with("allosaurus").and_return([page1, page2])
24
24
  allow(wiki).to receive(:revisions_by_title) # rubocop:todo RSpec/SubjectStub
25
- .with('brachiosaurus').and_return([page3])
25
+ .with("brachiosaurus").and_return([page3])
26
26
 
27
27
  expect(wiki.latest_revisions).to eq([page2, page3])
28
28
  end
29
29
  end
30
30
  end
31
31
 
32
- describe '#revisions_by_author' do
33
- context 'with revisions is empty' do
34
- context 'with titles is empty' do
35
- it 'returns empty array' do
32
+ describe "#revisions_by_author" do
33
+ context "with revisions is empty" do
34
+ context "with titles is empty" do
35
+ it "returns empty array" do
36
36
  allow(wiki).to receive(:titles).and_return [] # rubocop:todo RSpec/SubjectStub
37
- expect(wiki.revisions_by_title('title')).to eq []
37
+ expect(wiki.revisions_by_title("title")).to eq []
38
38
  end
39
39
  end
40
40
  end
41
41
 
42
- context 'with revisions are given' do
43
- context 'with title given' do
44
- it 'returns empty array' do # rubocop:todo RSpec/ExampleLength
42
+ context "with revisions are given" do
43
+ context "with title given" do
44
+ it "returns empty array" do # rubocop:todo RSpec/ExampleLength
45
45
  pages = []
46
- home1 = double(title: 'Home', time: Time.parse('2015-01-23')) # rubocop:todo RSpec/VerifiedDoubles
46
+ home1 = double(title: "Home", time: Time.parse("2015-01-23")) # rubocop:todo RSpec/VerifiedDoubles
47
47
  pages << home1
48
- pages << double(title: 'Example', time: Time.parse('2015-01-20')) # rubocop:todo RSpec/VerifiedDoubles
49
- pages << double(title: 'Authors', time: Time.parse('2015-01-30')) # rubocop:todo RSpec/VerifiedDoubles
50
- home2 = double(title: 'Home', time: Time.parse('2014-01-23')) # rubocop:todo RSpec/VerifiedDoubles
48
+ pages << double(title: "Example", time: Time.parse("2015-01-20")) # rubocop:todo RSpec/VerifiedDoubles
49
+ pages << double(title: "Authors", time: Time.parse("2015-01-30")) # rubocop:todo RSpec/VerifiedDoubles
50
+ home2 = double(title: "Home", time: Time.parse("2014-01-23")) # rubocop:todo RSpec/VerifiedDoubles
51
51
  pages << home2
52
52
  allow(wiki).to receive(:revisions).and_return pages # rubocop:todo RSpec/SubjectStub
53
- expect(wiki.revisions_by_title('Home')).to eq [home2, home1]
53
+ expect(wiki.revisions_by_title("Home")).to eq [home2, home1]
54
54
  end
55
55
  end
56
56
  end
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Caramelize::InputWiki::WikkaWiki do
6
6
  subject(:wiki) { described_class.new }
7
7
 
8
- describe '#filters' do
9
- it 'has 3 filters' do
8
+ describe "#filters" do
9
+ it "has 3 filters" do
10
10
  expect(wiki.filters.count).to be(3)
11
11
  end
12
12
  end