Sha256: 62c158ff9957561542f24f12988ffa53e5d4f59aebc0d7c1898168eb7380abf6

Contents?: true

Size: 634 Bytes

Versions: 3

Compression:

Stored size: 634 Bytes

Contents

require 'spec_helper'
module Polygon
  describe Entry, 'divide' do

    let(:entry){ Entry.new(Path.dir, Path.dir) }

    subject{ entry / path }

    context "when it stays inside the root" do
      let(:path){ "somewhere/somefile.yml" }
      it 'should return an Entry instance' do
        subject.should be_a(Entry)
      end
      it 'should return the correct instance' do
        subject.path.should eq(Path.dir / "somewhere/somefile.yml")
      end
    end

    context "when it exits the root" do
      let(:path){ "../somefile.yml" }
      it 'should return nil' do
        subject.should be_nil
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
polygon-0.10.1 spec/entry/test_divide.rb
polygon-0.10.0 spec/entry/test_divide.rb
polygon-0.9.1 spec/entry/test_divide.rb