Sha256: adfe68bcfe515af98584a953ccaa46ddf8965ba7b6dba31653dbec8814f15445

Contents?: true

Size: 396 Bytes

Versions: 4

Compression:

Stored size: 396 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

4 entries across 4 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-core/assumptions/test_file.rb
alf-core-0.14.0 spec/unit/alf-core/assumptions/test_file.rb
alf-core-0.13.1 spec/unit/alf-core/assumptions/test_file.rb
alf-core-0.13.0 spec/unit/alf-core/assumptions/test_file.rb