Sha256: a94c10d3b974993732bad2abcf039b9685d592e1b2fac6e2e2e320e4ca86c913

Contents?: true

Size: 693 Bytes

Versions: 8

Compression:

Stored size: 693 Bytes

Contents

require File.expand_path('../../spec_helper', __FILE__)

describe 'XCRes::FileHelper' do

  def subject
    Class.new.class_eval { include XCRes::FileHelper }.new
  end

  describe '#basename_without_ext' do
    it 'should raise if the name is not given' do
      -> { subject.basename_without_ext(nil) }.should.raise?(TypeError)
    end

    it 'should return the name itself if there is not extension' do
      subject.basename_without_ext('dir/base').should.be.eql?('base')
    end

    it 'should return the name without extension' do
      subject.basename_without_ext('b/a.gif').should.be.eql?('a')
      subject.basename_without_ext('b/A.bundle').should.be.eql?('A')
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
xcres-0.6.1 spec/unit/helper/file_helper_spec.rb
xcres-0.6.0 spec/unit/helper/file_helper_spec.rb
xcres-0.5.0 spec/unit/helper/file_helper_spec.rb
xcres-0.4.4 spec/unit/helper/file_helper_spec.rb
xcres-0.4.3 spec/unit/helper/file_helper_spec.rb
xcres-0.4.2 spec/unit/helper/file_helper_spec.rb
xcres-0.4.1 spec/unit/helper/file_helper_spec.rb
xcres-0.4.0 spec/unit/helper/file_helper_spec.rb