You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parsing of --example from SPEC_OPTS or .rspec is broken.
In both cases the options are parsed by splitting it based on spaces, which means
that spaces can not be included in the example argument. For example:
$ SPEC_OPTS='--example "foo bar"' /usr/local/rvm/rubies/ruby-1.9.3-p125/bin/ruby -I /home/cross/tail/work/accept -I /home/cross/tail/accept /usr/local/rvm/gems/ruby-1.9.3-p125/bin/rspec -fn /home/cross/tail/accept/twtail_spec_short.rb /home/cross/tail/accept/twtail_spec.rb
env_options:
ENV[SPEC_OPTS]: --example "foo bar"
split: {:full_description=>/"foo/}
Run options: include {:full_description=>/(?-mix:"foo)/}
All examples were filtered out
Finished in 0.00003 seconds
0 examples, 0 failures
$
As you can see rspec only associated the "foo with the --example because the arguments
are split based on spaces:
To get around this previously we would replace all spaces with .'s (periods) which would
work fine with Regexp, but with the newer versions of RSpec escape the Regexp:
parser.on('-e', '--example STRING', "Run examples whose full nested names include STRING") do |o|
options[:full_description] = Regexp.compile(Regexp.escape(o))
end
While this corrects the behavior for processing --example from the command line it
further breaks processing --example from SPEC_OPTS or the .rpsec file.
The text was updated successfully, but these errors were encountered:
The parsing of --example from SPEC_OPTS or .rspec is broken.
In both cases the options are parsed by splitting it based on spaces, which means
that spaces can not be included in the example argument. For example:
As you can see rspec only associated the "foo with the --example because the arguments
are split based on spaces:
To get around this previously we would replace all spaces with .'s (periods) which would
work fine with Regexp, but with the newer versions of RSpec escape the Regexp:
While this corrects the behavior for processing --example from the command line it
further breaks processing --example from SPEC_OPTS or the .rpsec file.
The text was updated successfully, but these errors were encountered: