When I ran the install, the following was added to the spec_helper (with
the comments removed for brevity):
require "watir/rspec"
RSpec.configure do |config|
config.add_formatter(:progress) if config.formatters.empty?
config.add_formatter(Watir::RSpec::HtmlFormatter)
config.before :all do
@browser = Watir::Browser.new
end
config.after :all do
@browser.close if @browser
end
config.include Watir::RSpec::Helper
config.include Watir::RSpec::Matchers
end
The "goto" method is added to examples by the "config.include
Watir::RSpec::Helper" line. Though you will likely want to include all of
these lines if you are just starting out.
Justin
On Tuesday, October 4, 2016 at 11:28:23 AM UTC-4, [email protected]
wrote:
>
> Thank you very much for your reply
> Yes, I ran install.
> IIRC correctly there were two lines of output.
> I did not make a copy of the spec_helper before I ran the install.
> What should I look for in there?
>
> thanks!
> -AZ
>
>
> On Tuesday, October 4, 2016 at 6:52:30 AM UTC-7, Justin Ko wrote:
>>
>> It sounds like the Watir::RSpec::Helper has not been added to the example
>> groups.
>>
>> Did you run the "watir-rspec install" (see last step of installation)?
>> The install augments your project's spec_helper file to include this module
>> and other related parts.
>>
>> In terms of the debugging question, I do not have much advice. With
>> undefined method errors, I suppose you need to figure out where the method
>> is supposed to be defined and then figure out why it isn't being included.
>> If you have some familiarity with RSpec and Watir, you might be able to
>> guess that "goto" method is being done by Watir-RSpec. You can dig through
>> the code to figure out where it defines the "goto" method - though this one
>> is a bit difficult since it is implemented using method_missing in the
>> Watir::RSpec::Helper. From there, you would look at why it is not being
>> included in your RSpec config, which might lead you to noticing your
>> spec_helper hasn't been updated.
>>
>> Justin
>>
>>
--
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.