Sha256: f51f0cba62f3dc8323c849d0f51609d3bed25ea34ba63912ce8b6ac18d5115bf

Contents?: true

Size: 398 Bytes

Versions: 8

Compression:

Stored size: 398 Bytes

Contents

require 'spec_helper' 
describe "__FILE__" do

  describe "when used with eval within same file" do
    let(:src){ "__FILE__" }
    subject{ Kernel.eval(src, binding, __FILE__) }
    it { should == __FILE__ }
  end
  
  describe "when used with eval from other file" do
    let(:src){ "__FILE__" }
    subject{ Kernel.eval(src, binding, "hello.rb") }
    it { should == "hello.rb" }
  end
  
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
alf-0.12.2 spec/unit/alf-core/assumptions/test_file.rb
alf-0.12.1 spec/unit/alf-core/assumptions/test_file.rb
alf-0.12.0 spec/unit/alf-core/assumptions/test_file.rb
alf-0.11.1 spec/unit/alf-core/assumptions/test_file.rb
alf-0.11.0 spec/unit/alf-core/assumptions/test_file.rb
alf-0.10.1 spec/unit/assumptions/test_file.rb
alf-0.10.0 spec/unit/assumptions/test_file.rb
alf-0.9.3 spec/unit/assumptions/test_file.rb