spec/downloader_spec.rb in oddb2xml-2.7.3 vs spec/downloader_spec.rb in oddb2xml-2.7.4
- old
+ new
@@ -254,10 +254,11 @@
# require "pry"; binding.pry
end
end
VCR.eject_cassette
VCR.insert_cassette("oddb2xml", tag: :swissmedic, exclusive: false)
+ FileUtils.rm_rf(Oddb2xml::DOWNLOADS, verbose: true)
common_before
@downloader = Oddb2xml::SwissmedicDownloader.new(:orphan)
end
after(:each) { common_after }
it_behaves_like "any downloader"
@@ -274,12 +275,15 @@
it "should clean up current directory" do
unless [:orphan, :package].index(@downloader.type)
expect { bin }.not_to raise_error
expect(File.exist?("oddb_orphan.xls")).to eq(false)
end
+ expect(File.dirname(bin)).to be == (Oddb2xml::DOWNLOADS)
+ expect(File.exist?(bin)).to eq(true)
end
- it "should not save into the download directory" do
- expect(File.exist?(File.join(Oddb2xml::DOWNLOADS, "oddb_orphan.xls"))).to eq(false)
+ it "should save into the download directory" do
+ expect(File.exist?(bin)).to eq(true)
+ expect(File.exist?(File.join(Oddb2xml::DOWNLOADS, "swissmedic_orphan.xlsx"))).to eq(true)
end
end
end
context "package" do
before(:each) do