spec/prerelease_spec.rb in xcode-install-0.3.3 vs spec/prerelease_spec.rb in xcode-install-0.9.0
- old
+ new
@@ -1,30 +1,30 @@
require File.expand_path('../spec_helper', __FILE__)
module XcodeInstall
describe Installer do
def fixture(date)
- Nokogiri::HTML.parse(File.read("spec/fixtures/devcenter/xcode-#{date}.html"))
+ File.read("spec/fixtures/devcenter/xcode-#{date}.html")
end
def parse_prereleases(date)
fixture = fixture(date)
- Nokogiri::HTML.stubs(:parse).returns(fixture)
+ @result.stubs(:body).returns(fixture)
installer = Installer.new
installer.send(:prereleases)
end
before do
devcenter = mock
devcenter.stubs(:download_file).returns(nil)
Installer.any_instance.stubs(:devcenter).returns(devcenter)
- result = mock
- result.stubs(:body).returns(nil)
+ @result = mock
+ @result.stubs(:body).returns(nil)
client = mock
- client.stubs(:request).returns(result)
- Spaceship::Client.stubs(:login).returns(client)
+ client.stubs(:request).returns(@result)
+ Spaceship::PortalClient.stubs(:login).returns(client)
end
it 'can parse prereleases from 20150414' do
prereleases = parse_prereleases('20150414')