Skip to content

Commit

Permalink
Fix rspec already initialized constant warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Krugloff committed Jul 9, 2024
1 parent 21066aa commit 3ac73a3
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions specs/knowledge_graph_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@
'van-gogh-paintings-masonry'
].each_with_object({}) { |name, result| result[name] = File.read("./files/#{name}.html") }

DUMMY_HTML = <<~HTM.gsub("\n\n", '').gsub("\n", ' ').squeeze(' ').gsub('> <', '><')
<g-scrolling-carousel>
<a
class="klitem"
aria-label="The Starry Night"
href="/search?something"
title="The Starry Night (1889)">
<g-img><img id="kximg0"></g-img>
</a>
<a
class="klitem"
aria-label="Sunflowers"
href="/search?something"
title="Sunflowers">
<g-img><img id="kximg2"></g-img>
</a>
</g-scrolling-carousel>
<script>function _setImagesSrc(function(){var s='blob';var ii=['kximg0'];</script>
HTM

# it is not standard spec per file of course
[NokogiriBased, NokolexborBased, RegexpBased, StringScannerBased].each do |namespace|
# heh, nobody likes shared examples :)
Expand Down Expand Up @@ -61,28 +83,6 @@
end

describe 'issues' do
DUMMY_HTML = <<~HTM.gsub("\n\n", '').gsub("\n", ' ').squeeze(' ').gsub('> <', '><')
<g-scrolling-carousel>
<a
class="klitem"
aria-label="The Starry Night"
href="/search?something"
title="The Starry Night (1889)">
<g-img><img id="kximg0"></g-img>
</a>
<a
class="klitem"
aria-label="Sunflowers"
href="/search?something"
title="Sunflowers">
<g-img><img id="kximg2"></g-img>
</a>
</g-scrolling-carousel>
<script>function _setImagesSrc(function(){var s='blob';var ii=['kximg0'];</script>
HTM

let(:graph) { described_class.new(dummy_html).to_h }

context 'with the correct input' do
Expand Down

0 comments on commit 3ac73a3

Please sign in to comment.