Hi, I'd like to offer this suggestion for changes to the RSpec syntax to use expect. More than just a style change, it has turned turned out that using 'expect' over 'should' is a recommended practice because of dealing with delegate/proxy objects as detailed in http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax As detailed in the blog post "In the future, we plan to change the defaults so that only expect is available unless you explicitly enable should. We may do this as soon as RSpec 3.0, but we want to give users plenty of time to get acquianted with it." I changed the pattern matchers from =~ to match() as required for this change and while at it I also took the opportunity to change the == format to eq as recommended in the post. I switched from lamba {} to expect{} as detailed in http://stackoverflow.com/questions/4191016/which-style-lambda-should-or-expect-to-is-preferred-for-testing-expectations?rq=1. I made these changes in the main spec/ files and also in the these spec/watirspec files (approx 90+ files, 1000+ tests) which I forked separately here. All tests pass. You can merge this Pull Request by running:
git pull https://github.com/durrantm/watirspec master Or you can view, comment on it, or merge it online at: https://github.com/watir/watirspec/pull/39 -- Commit Summary -- * Change from RSpect should syntax to expect syntax. Also from == to eq. Also from =~ to match() -- File Changes -- M alert_spec.rb (20) M area_spec.rb (48) M areas_spec.rb (14) M browser_spec.rb (125) M button_spec.rb (196) M buttons_spec.rb (18) M checkbox_spec.rb (178) M checkboxes_spec.rb (16) M collections_spec.rb (4) M cookies_spec.rb (22) M dd_spec.rb (78) M dds_spec.rb (14) M del_spec.rb (84) M dels_spec.rb (12) M div_spec.rb (148) M divs_spec.rb (14) M dl_spec.rb (86) M dls_spec.rb (16) M drag_and_drop_spec.rb (14) M dt_spec.rb (78) M dts_spec.rb (14) M element_spec.rb (126) M em_spec.rb (64) M ems_spec.rb (16) M filefield_spec.rb (86) M filefields_spec.rb (14) M font_spec.rb (10) M form_spec.rb (58) M forms_spec.rb (16) M frame_spec.rb (76) M frames_spec.rb (12) M hidden_spec.rb (74) M hiddens_spec.rb (16) M hn_spec.rb (60) M hns_spec.rb (12) M iframe_spec.rb (74) M iframes_spec.rb (10) M image_spec.rb (112) M images_spec.rb (10) M ins_spec.rb (84) M inses_spec.rb (12) M label_spec.rb (48) M labels_spec.rb (10) M li_spec.rb (76) M link_spec.rb (102) M links_spec.rb (14) M lis_spec.rb (14) M map_spec.rb (50) M maps_spec.rb (14) M meta_spec.rb (6) M metas_spec.rb (12) M modal_dialog_spec.rb (14) M ol_spec.rb (64) M ols_spec.rb (12) M option_spec.rb (118) M p_spec.rb (76) M pre_spec.rb (76) M pres_spec.rb (12) M ps_spec.rb (12) M radio_spec.rb (166) M radios_spec.rb (14) M screenshot_spec.rb (10) M select_list_spec.rb (174) M select_lists_spec.rb (20) M span_spec.rb (84) M spans_spec.rb (12) M strong_spec.rb (62) M strongs_spec.rb (14) M table_nesting_spec.rb (12) M table_spec.rb (76) M tables_spec.rb (16) M tbody_spec.rb (66) M tbodys_spec.rb (20) M td_spec.rb (44) M tds_spec.rb (18) M text_field_spec.rb (176) M text_fields_spec.rb (18) M textarea_spec.rb (8) M textareas_spec.rb (8) M tfoot_spec.rb (62) M tfoots_spec.rb (22) M thead_spec.rb (62) M theads_spec.rb (22) M tr_spec.rb (42) M trs_spec.rb (20) M ul_spec.rb (48) M uls_spec.rb (12) M window_switching_spec.rb (94) -- Patch Links -- https://github.com/watir/watirspec/pull/39.patch https://github.com/watir/watirspec/pull/39.diff
_______________________________________________ Wtr-development mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-development
