Sha256: 9468da7b6d25f0ef35fcf8e88703207fb1789a0bbd43f7ab85ce896b983d6e9d
Contents?: true
Size: 1.62 KB
Versions: 2
Compression:
Stored size: 1.62 KB
Contents
require File.expand_path(File.join(File.dirname(__FILE__),"spec_helper.rb")) require 'stickler' describe Stickler::Repository do before( :each ) do @top_dir = File.join( "/tmp/stickler" ) @repo = Stickler::Repository.new( 'directory' => @top_dir ) Stickler::Console.silent { @repo.setup } end after( :each ) do FileUtils.rm_rf( @top_dir ) end describe "#setup" do %w[ gems log specifications dist cache].each do |sub_dir| it "creates #{sub_dir} directory" do new_dir = File.join( @top_dir , sub_dir ) File.directory?( new_dir ).should == true end end it "setup creates a default stickler.yml file" do s_yml = File.join( @top_dir, 'stickler.yml' ) s = YAML.load_file( s_yml ) s['sources'].size.should == 1 s['sources'].first.should == "http://gems.rubyforge.org" end end describe "validity checks" do %w[ gems log specifications dist cache].each do |sub_dir| it "raises error if #{sub_dir} is missing" do FileUtils.rmdir( File.join( @top_dir, sub_dir ) ) lambda { Stickler::Console.silent { @repo.valid! } }.should raise_error( Stickler::Repository::Error ) end it "return false if #{sub_dir} is missing" do FileUtils.rmdir( File.join( @top_dir, sub_dir ) ) Stickler::Console.silent{ @repo.should_not be_valid } end end it "can create a valid directory system" do @repo.should be_valid end end it "creates a configuration" do @repo.configuration['sources'].size.should == 1 @repo.configuration['sources'].first.should == "http://gems.rubyforge.org/" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
stickler-0.1.0 | spec/repository_spec.rb |
stickler-0.1.1 | spec/repository_spec.rb |