Sha256: 96f36606357b7042a4840fd30d5397cab00b340848766bb90822a5f844d7f0c0

Contents?: true

Size: 1.29 KB

Versions: 12

Compression:

Stored size: 1.29 KB

Contents

require_relative '../lib/projects.rb'
require 'fileutils'
describe Projects do

	it "should be able to add a new Project" do
		projects=Projects.new
		projects['github/dev_projects.gem'] = 'https://github.com/lou-parslow/dev_projects.gem.git'
		projects.update
		expect(projects['github/dev_projects.gem'].is_a?(Project)).to eq(true)
		expect(projects['github/dev_projects.gem'][:name]).to eq('github/dev_projects.gem')
	end

	it "should be able to store and load" do
		FileUtils.mkdir('tmp') if(!File.exists?('tmp'))
		FileUtils.rm('tmp/test.project.json') if(File.exists?('tmp/test.project.json'))
		expect(File.exists?('tmp/test.project.json')).to eq(false)

		projects=Projects.new
		projects['github/dev_projects.gem'] = 'https://github.com/lou-parslow/dev_projects.gem.git'
		projects.save 'tmp/test.project.json'
		expect(File.exists?('tmp/test.project.json')).to eq(true)

		projects2=Projects.new
		projects2.open 'tmp/test.project.json'
		expect(projects2['github/dev_projects.gem'].is_a?(Project)).to eq(true)
		FileUtils.rm('tmp/test.project.json') if(File.exists?('tmp/test.project.json'))
	end

	it "should be able to get the current Project" do
		expect(Projects.current).not_to eq(nil)
	end

	it "should be able to pull" do
		projects=Projects.new
		projects.pull

	end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dev_projects-0.0.26 spec/projects_spec.rb
dev_projects-0.0.25 spec/projects_spec.rb
dev_projects-0.0.24 spec/projects_spec.rb
dev_projects-0.0.23 spec/projects_spec.rb
dev_projects-0.0.22 spec/projects_spec.rb
dev_projects-0.0.21 spec/projects_spec.rb
dev_projects-0.0.20 spec/projects_spec.rb
dev_projects-0.0.19 spec/projects_spec.rb
dev_projects-0.0.18 spec/projects_spec.rb
dev_projects-0.0.17 spec/projects_spec.rb
dev_projects-0.0.16 spec/projects_spec.rb
dev_projects-0.0.15 spec/projects_spec.rb