Class: FocusedController::StubbedURL

Inherits:
Object
  • Object
show all
Defined in:
lib/focused_controller/test_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(helper_name, args) ⇒ StubbedURL

Returns a new instance of StubbedURL.



45
46
47
48
# File 'lib/focused_controller/test_helper.rb', line 45

def initialize(helper_name, args)
  @helper_name = helper_name.to_s
  @args        = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



43
44
45
# File 'lib/focused_controller/test_helper.rb', line 43

def args
  @args
end

#helper_nameObject (readonly)

Returns the value of attribute helper_name.



43
44
45
# File 'lib/focused_controller/test_helper.rb', line 43

def helper_name
  @helper_name
end

Instance Method Details

#==(other) ⇒ Object



50
51
52
53
54
# File 'lib/focused_controller/test_helper.rb', line 50

def ==(other)
  other.is_a?(self.class) &&
    helper_name == other.helper_name &&
    args        == other.args
end

#deleteObject



62
63
64
# File 'lib/focused_controller/test_helper.rb', line 62

def delete(*)
  self
end

#gsubObject

Deals with _compute_redirect_to_location in action_controller/metal/redirecting (I don’t feel proud about this…)



58
59
60
# File 'lib/focused_controller/test_helper.rb', line 58

def gsub(*)
  self
end

#to_sObject



66
67
68
# File 'lib/focused_controller/test_helper.rb', line 66

def to_s
  "#{helper_name}(#{args.each(&:to_s).join(', ')})"
end