On Sat, Oct 25, 2014 at 6:37 AM, S Page <[email protected]> wrote:

> E.g. https://github.com/cheezy/page-object/wiki/Elements has
>
>   button(:your_name, :id => 'an_id')
>
> but our features/support/foo_page.rb files have e.g.
>
>   h1(:first_heading, id: "firstHeading")
>
> is this Ruby strangeness, or just supporting alternative syntaxes?
>

`:id => 'an_id'` and `id: "firstHeading"` are Ruby hashes. The former is
the Ruby 1.8 syntax (hash rocket), the latter is Ruby 1.9+ syntax.

More information:

https://github.com/bbatsov/ruby-style-guide#no-mixed-hash-syntaces

RuboCop is instructed to allow both, at the moment. Example for Flow:

https://github.com/wikimedia/mediawiki-extensions-Flow/blob/master/.rubocop_todo.yml#L61-L65

Željko
_______________________________________________
QA mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/qa

Reply via email to