Sha256: 6cd8296bcab333975e2c713699514cce06c032f6f9a463df5d909309132af85c

Contents?: true

Size: 1.26 KB

Versions: 4

Compression:

Stored size: 1.26 KB

Contents

require 'spec_helper'

module RSpec::FileMatchers
  describe HaveDir do
    describe '#have_dir' do
      include FileHelper
    
      before :each do   
        remove_all_test
      end
  
      after :each do
        remove_all_test
      end
  
      it "should not have 'test' dir" do
        nil.should_not have_dir test_dir
      end
  
      it "should have 'test' dir" do      
        make_test_dir
        nil.should have_dir test_dir
      end
  
      it "should have 'test' dirs" do      
        make_test_dirs
        nil.should have_dirs test_dirs
      end
  
    end

    describe '#have_dir nested blocks' do
      include FileHelper
    
      before :each do   
        remove_all_test
      end

      # after :each do
      #   remove_all_test
      # end
  
      it "should have nested test dirs" do      
        make_nested_test_dirs       
        nil.should have_dir :test
        nil.should_not have_dir :test2
        nil.should have_dir test_dir do |dir|
          # puts "directory: #{dir.path}"
          # puts "directory: #{dir}"
          # puts File.expand_path(dir.path)
          dir.should have_dirs nested_test_dirs
          dir.should have_files test_files
        end      
        test_dir.should have_files test_files
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
file-spec-0.4.0 spec/file-spec/matchers/single/have_directory_spec.rb
file-spec-0.3.0 spec/file-spec/matchers/single/have_directory_spec.rb
file-spec-0.2.0 spec/file-spec/matchers/single/have_directory_spec.rb
file-spec-0.1.5 spec/file-spec/matchers/single/have_directory_spec.rb