File: join_test.rb

package info (click to toggle)
ruby-fakefs 3.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 544 kB
  • sloc: ruby: 7,606; makefile: 5
file content (23 lines) | stat: -rw-r--r-- 472 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require_relative '../../test_helper'

# File join test class
class FakeFileJoinTest < Minitest::Test
  def setup
    FakeFS.activate!
  end

  def teardown
    FakeFS.deactivate!
    FakeFS::FileSystem.clear
  end

  [
    ['a', 'b'], ['a/', 'b'], ['a', '/b'], ['a/', '/b'], ['a', '/', 'b']
  ].each_with_index do |args, i|
    define_method "test_file_join_#{i}" do
      assert_equal RealFile.join(args), File.join(args)
    end
  end
end