Skip to content

Commit

Permalink
No extra empty line detected at block body beginning/end.
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoporreca committed Feb 7, 2020
1 parent d0016ca commit e8f81dd
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions spec/html-proofer/cache_spec.rb
Expand Up @@ -110,9 +110,7 @@ def read_cache(cache_file)

context 'within date' do
let(:cache_file_name) { '.within_date.log' }

it 'does not write file if timestamp is within date' do

expect_any_instance_of(HTMLProofer::Cache).to receive(:write)

# we expect no add...
Expand All @@ -122,15 +120,12 @@ def read_cache(cache_file)
expect_any_instance_of(HTMLProofer::Cache).to receive(:within_timeframe?).and_return(within)

run_proofer(['www.github.com'], :links, cache: { timeframe: '30d', cache_file: cache_file_name }.merge(default_cache_options))

end
end

context 'not within date' do
let(:cache_file_name) { '.not_within_date.log' }

it 'does write file if timestamp is not within date' do

# mock within_timeframe
expect_any_instance_of(HTMLProofer::Cache).to receive(:write)

Expand All @@ -141,13 +136,11 @@ def read_cache(cache_file)
expect_any_instance_of(HTMLProofer::Cache).to receive(:within_timeframe?).and_return(within)

run_proofer(['www.github.com'], :links, cache: { timeframe: '4d', cache_file: cache_file_name }.merge(default_cache_options))

end
end

context 'new url added' do
let(:cache_file_name) { '.new_url.log' }

it 'does write file if a new URL is added' do
# this is frozen to within 7 days of the log
new_time = Time.local(2015, 10, 20, 12, 0, 0)
Expand All @@ -166,9 +159,7 @@ def read_cache(cache_file)

context 'recheck failure' do
let(:cache_file_name) { '.recheck_failure.log' }

it 'does recheck failures, regardless of cache' do

expect_any_instance_of(HTMLProofer::Cache).to receive(:write)

# we expect the same link to be readded...
Expand All @@ -178,7 +169,6 @@ def read_cache(cache_file)
expect_any_instance_of(HTMLProofer::Cache).to receive(:within_timeframe?).and_return(within)

run_proofer(['http://www.foofoofoo.biz'], :links, cache: { timeframe: '30d', cache_file: cache_file_name }.merge(default_cache_options))

end
end
end

0 comments on commit e8f81dd

Please sign in to comment.