Unable to use OptionParser and rspec
问题 I have a simple watir (web-driver) script which goes to google. But, I want to use option parser to set an argument in the cmd to select a browser. Below is my script: require 'optparse' require 'commandline/optionparser' include CommandLine require 'watir-webdriver' describe 'Test google website' do before :all do options = {} opts = OptionParser.new do |opts| opts.on("--browser N", "Browser to execute test scripts") do |n| options[:browser] = n $b = n.to_s end end opts.parse! ARGV p options