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

Commit 8ac1f69

Browse files
committed
Add a spec for shared example groups
Currently failing :(
1 parent 8715908 commit 8ac1f69

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
@@ -1912,5 +1912,25 @@ def group_ids group
19121912
expect(group.examples.length).to eq(0)
19131913
expect(original_ids).to_not eq(group_ids(group))
19141914
end
1915+
1916+
it 'allows extensions to add `method` to the DSL without causing problems' do
1917+
http_testing_extension = Module.new do
1918+
attr_reader :http_method
1919+
def method(meth); @http_method = meth; end
1920+
end
1921+
1922+
describe_successfully do
1923+
extend http_testing_extension
1924+
method :get
1925+
1926+
shared_examples_for("a get") do
1927+
it "allows `method` to specify the HTTP method" do
1928+
expect(self.class.http_method).to eq(:get)
1929+
end
1930+
end
1931+
1932+
it_behaves_like "a get"
1933+
end
1934+
end
19151935
end
19161936
end

0 commit comments

Comments
 (0)