spec/lib/scrapers/rubytapas/rubytapas_spec.rb in scrapers-3.0.0 vs spec/lib/scrapers/rubytapas/rubytapas_spec.rb in scrapers-3.1.0
- old
+ new
@@ -11,11 +11,10 @@
end
let(:download) { ['filename', 'body'] }
let(:cart) do
instance_spy("Scrapers::RubyTapas::DpdCart",
- :login! => "Subscription Content | RubyTapas",
:feed! => feed,
:download! => download
)
end
@@ -33,34 +32,34 @@
context "when scraping one episode" do
it "retrieves one episode" do
expect_any_instance_of(Scrapers::RubyTapas::Scraper).to receive(:scrape!).once.and_call_original
expect(cart).to receive(:download!).exactly(3).times
-
+
VCR.use_cassette('rubytapas-download-1', :match_requests_on => [:method, :host, :path, :query]) do
Scrapers::RubyTapas::CLI.start(%w[download 001 --destination=. --user=joan@example.com --pw=password])
end
end
-
+
end
context "when scraping all episodes" do
it "retrieves all episodes" do
expect_any_instance_of(Scrapers::RubyTapas::Scraper).to receive(:scrape!).once.and_call_original
expect(cart).to receive(:download!).exactly(933).times
-
+
VCR.use_cassette('rubytapas-download-all', :match_requests_on => [:method, :host, :path, :query]) do
save_stdout = $stdout
# $stdout = output
Scrapers::RubyTapas::CLI.start(%w[download all --destination=. --user=joan@example.com --pw=password])
$stdout = save_stdout
end
end
-
+
end
-
+
end
describe "list command" do
let(:feed) { File.read(File.join(File.expand_path("../", __FILE__), "test_data/feed.xml")) }
before do
@@ -71,10 +70,10 @@
it "provides a printout of the available feeds" do
expect(output).to receive(:puts).with(%r"001 *\t001 Binary Literals *\t2012-Sep-24")
Scrapers::RubyTapas::CLI.start(%w[list --user=joan@example.com --pw=password])
end
end
-
+
describe "version command" do
it "prints the version numbers for rubytapas and scrapers" do
save_stdout = $stdout
$stdout = output
expect(output).to receive(:print).with("rubytapas version: #{Scrapers::RubyTapas::VERSION}. scrapers version: #{Scrapers::VERSION}.\n")