Class: GraphicalTestsForRails::TextAppliers::TextAsNameOfPage

Inherits:
Object
  • Object
show all
Defined in:
lib/graphical_tests_for_rails/text-appliers.rb

Overview

This AbstractTextApplier is created with the name of a message. When handed a string to apply, it downcases and strips the string, then uses it as the single argument to the method. For example, this:

applier = TextAsNameOfPage.new("assert_on")
applier.apply("HOME")

turns into this:

applier.assert_on("home")

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ TextAsNameOfPage

When producing a method call, objects of this class will prepend the message to a single argument it constructs.



48
49
50
51
52
53
# File 'lib/graphical_tests_for_rails/text-appliers.rb', line 48

def initialize(message)
  user_claims(message == 'assert_on_page') {
    "At the moment, a TextAsNameOfPage must be given assert_on_page."
  }
  @message = message
end