Sha256: fd4214c4d3051c219c0e8c9e92e18ed627b344c843f32c5f06b728f79e195790

Contents?: true

Size: 1.32 KB

Versions: 1

Compression:

Stored size: 1.32 KB

Contents

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"))
		end

		def parse_prereleases(date)
			fixture = fixture(date)
			Nokogiri::HTML.stubs(:parse).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)
		end

		it 'can parse prereleases from 20150414' do
			prereleases = parse_prereleases('20150414')

			prereleases.should == [Xcode.new_prelease('6.4', '/Developer_Tools/Xcode_6.4_Beta/Xcode_6.4_beta.dmg')]
		end

		it 'can parse prereleases from 20150427' do
			prereleases = parse_prereleases('20150427')

			prereleases.should == [Xcode.new_prelease('6.4 beta 2', '/Developer_Tools/Xcode_6.4_beta_2/Xcode_6.4_beta_2.dmg')]
		end

		it 'can parse prereleases from 20150508' do
			prereleases = parse_prereleases('20150508')

			prereleases.count.should == 2
			prereleases.first.should == Xcode.new_prelease('6.3.2 GM seed', '/Developer_Tools/Xcode_6.3.2_GM_seed/Xcode_6.3.2_GM_seed.dmg')
			prereleases.last.should == Xcode.new_prelease('6.4 beta 2', '/Developer_Tools/Xcode_6.4_beta_2/Xcode_6.4_beta_2.dmg')
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
xcode-install-0.3.0 spec/prerelease_spec.rb