Sha256: 178dda95684f1150d84597f062c8e0369cae8dd7551c21b2782050771e7507c0

Contents?: true

Size: 542 Bytes

Versions: 2

Compression:

Stored size: 542 Bytes

Contents

require 'spec_helper'
module WLang
  describe Source, "path" do
    
    subject{ Source.new(source).path }

    context 'on a pure string' do
      let(:source){ "Hello world!" }
      it{ should be_nil }
    end

    context 'on a Path' do
      let(:source){ Path.file }
      it{ should eq(source.to_s) }
    end

    context 'on a File' do
      let(:source){ File.open(Path.file.to_s) }
      it{ should eq(__FILE__) }
    end

    it 'is aliased as to_path' do
      Source.new(Path.file).to_path.should eq(__FILE__)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wlang-3.0.1 spec/unit/source/test_path.rb
wlang-3.0.0 spec/unit/source/test_path.rb