Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 4156907

Browse files
committed
Add a spec for shared example groups
Currently failing :(
1 parent 3a586e1 commit 4156907

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

spec/rspec/core/example_group_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,5 +1867,25 @@ def group_ids group
18671867
expect(group.examples.length).to eq(0)
18681868
expect(original_ids).to_not eq(group_ids(group))
18691869
end
1870+
1871+
it 'allows extensions to add `method` to the DSL without causing problems' do
1872+
http_testing_extension = Module.new do
1873+
attr_reader :http_method
1874+
def method(meth); @http_method = meth; end
1875+
end
1876+
1877+
describe_successfully do
1878+
extend http_testing_extension
1879+
method :get
1880+
1881+
shared_examples_for("a get") do
1882+
it "allows `method` to specify the HTTP method" do
1883+
expect(self.class.http_method).to eq(:get)
1884+
end
1885+
end
1886+
1887+
it_behaves_like "a get"
1888+
end
1889+
end
18701890
end
18711891
end

0 commit comments

Comments
 (0)