File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
lib/rspec_api_documentation Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -25,9 +25,9 @@ def http_method
2525
2626 def should_document?
2727 return false if pending? || !metadata [ :resource_name ] || !metadata [ :document ]
28- return true if configuration . filter == :all
2928 return false if ( Array ( metadata [ :document ] ) & Array ( configuration . exclusion_filter ) ) . length > 0
3029 return true if ( Array ( metadata [ :document ] ) & Array ( configuration . filter ) ) . length > 0
30+ return true if configuration . filter == :all
3131 end
3232
3333 def public?
Original file line number Diff line number Diff line change 7070 end
7171
7272 context "configuration sets a filter" do
73- before do
73+ before do
7474 configuration . filter = :public
7575 configuration . exclusion_filter = :excluded
7676 end
9393 it { should be_false }
9494 end
9595 end
96+
97+ context "configuration only sets an exclusion filter" do
98+ before do
99+ configuration . exclusion_filter = :excluded
100+ end
101+
102+ context "when example doesn't match exclusion" do
103+ let ( :metadata ) { { :resource_name => "foo" , :document => :public } }
104+
105+ it { should be_true }
106+ end
107+
108+ context "when example matches exclusion" do
109+ let ( :metadata ) { { :resource_name => "foo" , :document => [ :public , :excluded ] } }
110+
111+ it { should be_false }
112+ end
113+ end
96114 end
97115
98116 describe "#public?" do
You can’t perform that action at this time.
0 commit comments