Sha256: 55f1f7ef1c484b246f5f3f63e633b459d8d714fd148f994ed31ade1534577bf8

Contents?: true

Size: 1.1 KB

Versions: 7

Compression:

Stored size: 1.1 KB

Contents

require "lib/andparcel"
require "rubygems"
require "protest"

Protest.context("The parcel engine") do
	setup do
		`rm -rf #{AndParcel.home}`
	end
	
	test "should properly initialize" do
		assert !File.exists?(AndParcel.home)
		AndParcel.init
		assert File.exists?(AndParcel.home)
		assert File.directory?(AndParcel.home)
	end
	
	test "should properly list the catalogs in a new environment" do
		assert !File.exists?(AndParcel.home)
		catalogs=AndParcel.catalogs
		assert catalogs.size==1
	end
	
	test "should support adding a new catalog" do
		assert !File.exists?(AndParcel.home)
		catalogs=AndParcel.catalogs
		catalogs.add('test', 'http://pub.andparcel.com/foo.json')
		assert catalogs.size==2
		assert catalogs.names.include?('test')
	end
	
	test "should support removing an existing catalog" do
		assert !File.exists?(AndParcel.home)
		catalogs=AndParcel.catalogs
		assert catalogs.size==1
		cat=catalogs.add('test', 'http://pub.andparcel.com/foo.json')
		assert catalogs.size==2
		assert catalogs.names.include?('test')
		catalogs.remove('test')
		assert catalogs.size==1
		assert !catalogs.names.include?('test')
	end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
andparcel-0.4.1 test/test_init.rb
andparcel-0.4.0 test/test_init.rb
andparcel-0.3.2 test/test_init.rb
andparcel-0.3.0 test/test_init.rb
andparcel-0.2.1 test/test_init.rb
andparcel-0.2.0 test/test_init.rb
andparcel-0.1.0 test/test_init.rb