Class: TestUtils::FakeSafeBuffer

Inherits:
Struct
  • Object
show all
Defined in:
test/utils_test.rb

Overview

emulates ActiveSupport::SafeBuffer#gsub

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#stringObject

Returns the value of attribute string

Returns:

  • (Object)

    the current value of string



9
10
11
# File 'test/utils_test.rb', line 9

def string
  @string
end

Instance Method Details

#gsub(regex) ⇒ Object



11
12
13
14
15
16
# File 'test/utils_test.rb', line 11

def gsub(regex)
  string.gsub(regex) {
    match, = $&, '' =~ /a/
    yield(match)
  }
end

#to_sObject



10
# File 'test/utils_test.rb', line 10

def to_s() self end