episode-116/store/vendor/plugins/selenium-on-rails/test/rselenese_test.rb
# Call _command_ with _args_ and make sure it produces a good table.
# If the input command doesn't 'selenize' cleanly (e.g. if the input command
# is :do_foo and the expected result is +dofoo+ and not +doFoo+) +command+
# can be specified as an array (e.g. +[:input_command, 'expectedResult']+).

Call _command_ with _args_ and make sure it produces a good table.
If the input command doesn't 'selenize' cleanly  +command+
can be specified as an array .
Call _command_ with _args_ and make sure it produces a good table . If the input command doesn ' t ' selenize ' cleanly + command + can be specified as an array .
def assert_command_works command, *args
    expected_values = args.inject([]) do |c, arg|
      v = ARG_VALUE_MAP[arg]
      if v.is_a? Array
        c << v[1]
      else
        c << v
      end
    end
    input_values = args.inject([]) do |c, arg|
      v = ARG_VALUE_MAP[arg]
      if v.is_a? Array
        c.concat v[0]
      else
        c << v
      end
    end
    input_name, expected_name  = (command.is_a?(Array) ? command : [command, SeleniumOnRails::TestBuilder.selenize(command.to_s)])
    assert_generates_command [expected_name]+expected_values, input_name.to_s, *input_values
  end
def assert_command_works command , * args expected_values = args . inject ( [ ] ) do | c , arg | v = ARG_VALUE_MAP [ arg ] if v . is_a? Array c << v [ 1 ] else c << v end end input_values = args . inject ( [ ] ) do | c , arg | v = ARG_VALUE_MAP [ arg ] if v . is_a? Array c . concat v [ 0 ] else c << v end end input_name , expected_name = ( command . is_a? ( Array ) ? command : [ command , SeleniumOnRails :: TestBuilder . selenize ( command . to_s ) ] ) assert_generates_command [ expected_name ] + expected_values , input_name . to_s , * input_values end
Call _command_ with _args_ and make sure it produces a good table.
Call _command_ with _args_ and make sure it produces a good table .
command
args