HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.5.9/spec/mspec/lib/mspec/helpers/fixture.rb
# Returns the name of a fixture file by adjoining the directory
# of the +file+ argument with "fixtures" and the contents of the
# +args+ array. For example,
#
#   +file+ == "some/example_spec.rb"
#
# and
#
#   +args+ == ["subdir", "file.txt"]
#
# then the result is the expanded path of
#
#   "some/fixtures/subdir/file.txt".
def fixture(file, *args)
  path = File.dirname(file)
  path = path[0..-7] if path[-7..-1] == "/shared"
  fixtures = path[-9..-1] == "/fixtures" ? "" : "fixtures"
  if File.respond_to?(:realpath)
    path = File.realpath(path)
  else
    path = File.expand_path(path)
  end
  File.join(path, fixtures, args)
end