Sha256: 35f27021a792c83e11e765e4900fb019a3714050ad7fdf45d2f35a8040a50bfb

Contents?: true

Size: 1.14 KB

Versions: 24

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'

require 'rad/spec/environment'

describe "Environment basic spec" do
  with_load_path "#{spec_dir}/path1", "#{spec_dir}/path2"
  
  before :all do
    @path1, @path2 = "#{spec_dir}/path1", "#{spec_dir}/path2"
  end
  
  describe 'files' do    
    it "find_files?" do
      environment.file_exist?('/some_folder/some_file').should be_true
      environment.file_exist?('/file1').should be_true
    end
    
    it "find_file" do
      lambda{environment.find_file('/some_folder/some_file')}.should raise_error(/Found multiple files/)
      environment.find_file('/file1').should == "#{@path1}/file1"
      lambda{environment.find_file('file1')}.should raise_error(AssertionError)
    end
    
    it "find_files" do
      environment.find_files('/some_folder/some_file').sort.should == ["#{@path1}/some_folder/some_file", "#{@path2}/some_folder/some_file"]
    end
    
    it "find_files_by_pattern" do
      environment.find_files_by_pattern('/*/some_file').sort.should == ["#{@path1}/some_folder/some_file", "#{@path2}/some_folder/some_file"]
    end
  end
  
  describe 'config' do
    it "smoke test" do
      rad.config
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rad_core-0.2.6 spec/environment/environment_spec.rb
rad_core-0.2.5 spec/environment/environment_spec.rb
rad_core-0.2.4 spec/environment/environment_spec.rb
rad_core-0.2.3 spec/environment/environment_spec.rb
rad_core-0.2.2 spec/environment/environment_spec.rb
rad_core-0.2.1 spec/environment/environment_spec.rb
rad_core-0.2.0 spec/environment/environment_spec.rb
rad_core-0.0.30 spec/environment/environment_spec.rb
rad_core-0.0.29 spec/environment/environment_spec.rb
rad_core-0.0.28 spec/environment/environment_spec.rb
rad_core-0.0.27 spec/environment/environment_spec.rb
rad_core-0.0.26 spec/environment/environment_spec.rb
rad_core-0.0.25 spec/environment/environment_spec.rb
rad_core-0.0.24 spec/environment/environment_spec.rb
rad_core-0.0.23 spec/environment/environment_spec.rb
rad_core-0.0.22 spec/environment/environment_spec.rb
rad_core-0.0.21 spec/environment/environment_spec.rb
rad_core-0.0.20 spec/environment/environment_spec.rb
rad_core-0.0.19 spec/environment/environment_spec.rb
rad_core-0.0.18 spec/environment/environment_spec.rb