summaryrefslogtreecommitdiff
path: root/test/lib/with_different_ofs.rb
blob: 559ed6a1d1263b1f58b96d29b6cb4046272c6c55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true
module DifferentOFS
  module WithDifferentOFS
    def setup
      super
      verbose, $VERBOSE = $VERBOSE, nil
      @ofs, $, = $,, "-"
      $VERBOSE = verbose
    end
    def teardown
      verbose, $VERBOSE = $VERBOSE, nil
      $, = @ofs
      $VERBOSE = verbose
      super
    end
  end

  def self.extended(klass)
    super(klass)
    klass.const_set(:DifferentOFS, Class.new(klass).class_eval {include WithDifferentOFS}).name
  end
end