spec/basic_gem/gemspec_spec.rb in oct-0.2.0 vs spec/basic_gem/gemspec_spec.rb in oct-0.3.1

- old
+ new

@@ -1,14 +1,14 @@ -require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') +require 'spec_helper' describe Oct do def load_gemspec filename = File.expand_path('../../../oct.gemspec', __FILE__) eval(File.read(filename), nil, filename) end - + describe 'gemspec' do it "should return the gem VERSION" do @gemspec = load_gemspec Oct::version.should_not be_nil @@ -25,35 +25,23 @@ it "should return 'executables' array" do @gemspec = load_gemspec @gemspec.executables.is_a?(Array).should == true end - describe 'without an existing cache' do + describe 'without .gemfiles cache' do before(:each) do File.stub!('exists?').and_return false @gemspec = load_gemspec end - it "should not blow up" do + it "should return 'files' from using 'git ls-files" do + File.exists?(File.expand_path('../../../.gemfiles', __FILE__)).should == false @gemspec.files.is_a?(Array).should == true @gemspec.files.include?('VERSION').should == true end - end - - describe 'without a git repo' do - before(:each) do - File.stub!('directory?').and_return false - @gemspec = load_gemspec - end - - it "should return 'files' from cache" do - File.directory?(File.expand_path('../../../.git', __FILE__)).should == false - @gemspec.files.is_a?(Array).should == true - @gemspec.files.include?('VERSION').should == true - end - it "should return 'executables' from cache" do - File.directory?(File.expand_path('../../../.git', __FILE__)).should == false + it "should return 'executables' from 'git ls-files" do + File.exists?(File.expand_path('../../../.gemfiles', __FILE__)).should == false @gemspec.executables.is_a?(Array).should == true end end describe 'without git binary' do @@ -62,15 +50,15 @@ stub!(:system).and_return false @gemspec = load_gemspec end it "should return 'files' from cache" do - system('git --version').should == false + system('git --version').should == false @gemspec.files.is_a?(Array).should == true @gemspec.files.include?('VERSION').should == true end it "should return 'executables' from cache" do - system('git --version').should == false + system('git --version').should == false @gemspec.executables.is_a?(Array).should == true end end end