Sha256: 1ef34146b17d0aca7b693e56a5e72bdcece61b545b33fd0ce20c17d53e4da7fb

Contents?: true

Size: 616 Bytes

Versions: 28

Compression:

Stored size: 616 Bytes

Contents

require 'lib/ramaze/spec/helper/snippets'

describe '__DIR__' do
  # this is hardly exhaustive, but better than nothing
  it 'should report the directory of the current file' do
    __DIR__.should == File.dirname(File.expand_path(__FILE__))
  end

  should 'join passed arguments and prefix with directory of current file' do
    __DIR__(:foo).should == File.join(File.dirname(File.expand_path(__FILE__)), 'foo')
    __DIR__('foo/bar').should == File.join(File.dirname(File.expand_path(__FILE__)), 'foo/bar')
    __DIR__(:foo, :bar).should == File.join(File.dirname(File.expand_path(__FILE__)), 'foo/bar')
  end
end

Version data entries

28 entries across 28 versions & 5 rubygems

Version Path
Pistos-ramaze-2008.12 spec/snippets/object/__dir__.rb
Pistos-ramaze-2009.01 spec/snippets/object/__dir__.rb
Pistos-ramaze-2009.02 spec/snippets/object/__dir__.rb
Pistos-ramaze-2009.04.08 spec/snippets/object/__dir__.rb
manveru-ramaze-2008.12 spec/snippets/object/__dir__.rb
manveru-ramaze-2009.01 spec/snippets/object/__dir__.rb
manveru-ramaze-2009.04.01 spec/snippets/object/__dir__.rb
manveru-ramaze-2009.04.08 spec/snippets/object/__dir__.rb
manveru-ramaze-2009.04.18 spec/snippets/object/__dir__.rb
manveru-ramaze-2009.04.22 spec/snippets/object/__dir__.rb
manveru-ramaze-2009.04 spec/snippets/object/__dir__.rb
manveru-ramaze-2009.05.08 spec/snippets/object/__dir__.rb
manveru-ramaze-2009.05 spec/snippets/object/__dir__.rb
manveru-ramaze-2009.06.04 spec/snippets/object/__dir__.rb
manveru-ramaze-2009.06.12 spec/snippets/object/__dir__.rb
manveru-ramaze-2009.06 spec/snippets/object/__dir__.rb
ptomato-ramaze-2009.02.1 spec/snippets/object/__dir__.rb
ptomato-ramaze-2009.02 spec/snippets/object/__dir__.rb
rjspotter-ramaze-2009.06.29 spec/snippets/object/__dir__.rb
rjspotter-ramaze-2009.06.31 spec/snippets/object/__dir__.rb