Sha256: 0e5ffae72f7e02fd95009ec3cf3f20ad689801a41bd293bcea35a01e51c53dd8

Contents?: true

Size: 806 Bytes

Versions: 14

Compression:

Stored size: 806 Bytes

Contents

#          Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)

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

14 entries across 14 versions & 3 rubygems

Version Path
Pistos-ramaze-2009.06.12 spec/snippets/object/__dir__.rb
manveru-ramaze-2009.07 spec/snippets/object/__dir__.rb
ramaze-2011.12.28 spec/snippets/object/__dir__.rb
ramaze-2011.10.23 spec/snippets/object/__dir__.rb
ramaze-2011.07.25 spec/snippets/object/__dir__.rb
ramaze-2011.01.30 spec/snippets/object/__dir__.rb
ramaze-2011.01 spec/snippets/object/__dir__.rb
ramaze-2010.06.18 spec/snippets/object/__dir__.rb
ramaze-2010.04.04 spec/snippets/object/__dir__.rb
ramaze-2010.04 spec/snippets/object/__dir__.rb
ramaze-2010.03 spec/snippets/object/__dir__.rb
ramaze-2010.01 spec/snippets/object/__dir__.rb
ramaze-2009.10 spec/snippets/object/__dir__.rb
ramaze-2009.07 spec/snippets/object/__dir__.rb