Class: GraphicalTestsForRails::UserIntention::Applier
- Defined in:
- lib/graphical_tests_for_rails/user-intention.rb
Instance Method Summary collapse
- #apply_claim_quote_args(string) ⇒ Object
- #apply_do_nothing(string) ⇒ Object
- #apply_page_name(string) ⇒ Object
- #apply_user_action_quote_args(string) ⇒ Object
- #do_it(*message_send) ⇒ Object
-
#initialize(target, log) ⇒ Applier
constructor
A new instance of Applier.
Constructor Details
#initialize(target, log) ⇒ Applier
Returns a new instance of Applier.
182 183 184 185 |
# File 'lib/graphical_tests_for_rails/user-intention.rb', line 182 def initialize(target, log) @target = target @log = log end |
Instance Method Details
#apply_claim_quote_args(string) ⇒ Object
204 205 206 |
# File 'lib/graphical_tests_for_rails/user-intention.rb', line 204 def apply_claim_quote_args(string) do_it(*(string)) end |
#apply_do_nothing(string) ⇒ Object
212 213 214 |
# File 'lib/graphical_tests_for_rails/user-intention.rb', line 212 def apply_do_nothing(string) @log << "# '#{string}' ignored." end |
#apply_page_name(string) ⇒ Object
208 209 210 |
# File 'lib/graphical_tests_for_rails/user-intention.rb', line 208 def apply_page_name(string) do_it('assert_on_page', string.downcase.strip) end |
#apply_user_action_quote_args(string) ⇒ Object
193 194 195 196 197 198 199 200 201 |
# File 'lib/graphical_tests_for_rails/user-intention.rb', line 193 def apply_user_action_quote_args(string) user_claims(string =~ /^\s*(\w+)\s+(.*)$/) { "'#{string}' cannot be split into a name and an action." } name = $1.downcase rest = ($2) = rest.shift do_it(, name, *rest) end |
#do_it(*message_send) ⇒ Object
187 188 189 190 |
# File 'lib/graphical_tests_for_rails/user-intention.rb', line 187 def do_it(*) @log << readable(*) @target.send(*) end |