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.0.17 spec/environment/environment_spec.rb
rad_core-0.0.16 spec/environment/environment_spec.rb
rad_core-0.0.15 spec/environment/environment_spec.rb
rad_core-0.0.14 spec/environment/environment_spec.rb