Skip to content

Commit 17b5772

Browse files
committed
Adds abstract BaseScraper#scrape method
1 parent f755577 commit 17b5772

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lib/bnet_scraper/starcraft2/base_scraper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ def profile_url bnet_index = @bnet_index
4444
def region_info
4545
REGIONS[region]
4646
end
47+
48+
def scrape
49+
raise NotImplementedError, "Abstract method #scrape called."
50+
end
4751
end
4852
end
4953
end

spec/starcraft2/base_scraper_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@
55
let(:scraper_class) { BnetScraper::Starcraft2::BaseScraper }
66
let(:subject) { scraper_class.new(url: 'http://us.battle.net/sc2/en/profile/2377239/1/Demon/') }
77
end
8+
9+
describe '#scrape' do
10+
it 'should raise an error calling scrape' do
11+
expect { subject.scrape }.to raise_error NotImplementedError
12+
end
13+
end
814
end

0 commit comments

Comments
 (0)