Skip to content

Commit

Permalink
Merge pull request #387 from yannlugrin/drb_with_exclusion_tags
Browse files Browse the repository at this point in the history
Allow tag exclusion filtering when using drb
  • Loading branch information
justinko committed May 26, 2011
2 parents 3cab6c2 + b6a71b7 commit 4ef0c29
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/rspec/core/configuration_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def drb_argv
argv << "--tag" << k.to_s
end
end
if options[:exclusion_filter]
options[:exclusion_filter].each_pair do |k, v|
argv << "--tag" << "~#{k.to_s}"
end
end
if options[:formatters]
options[:formatters].each do |pair|
argv << "--format" << pair[0]
Expand Down
15 changes: 13 additions & 2 deletions spec/rspec/core/configuration_options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,27 @@ def parse_options(*args)
end

context "with tags" do
it "includes the tags" do
it "includes the inclusion tags" do
coo = config_options_object("--tag", "tag")
coo.drb_argv.should eq(["--tag", "tag"])
end

it "leaves tags intact" do
it "leaves inclusion tags intact" do
coo = config_options_object("--tag", "tag")
coo.drb_argv
coo.options[:filter].should eq( {:tag=>true} )
end

it "includes the exclusion tags" do
coo = config_options_object("--tag", "~tag")
coo.drb_argv.should eq(["--tag", "~tag"])
end

it "leaves exclusion tags intact" do
coo = config_options_object("--tag", "~tag")
coo.drb_argv
coo.options[:exclusion_filter].should eq( {:tag=>true} )
end
end

context "with formatters" do
Expand Down

0 comments on commit 4ef0c29

Please sign in to comment.