Skip to content

Commit a65e658

Browse files
committed
Adding specs to cover module inclusion
1 parent d3f71e4 commit a65e658

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

lib/rspec-steps/describer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def include(mod)
5151
end
5252

5353
def extend(mod)
54-
@modules << ModuleExtendsion.new(mod)
54+
@modules << ModuleExtension.new(mod)
5555
end
5656

5757
def perform_steps(name)

spec/example_group_spec.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,29 @@
1919
end
2020
end
2121

22+
it "should handle inclusion and extension with modules" do
23+
module Testing
24+
def something
25+
42
26+
end
27+
end
28+
29+
group = nil
30+
sandboxed do
31+
group = RSpec.steps "Test Steps" do
32+
include Testing
33+
extend Testing
34+
35+
it("accesses a method from a module"){ expect(something).to eq 42 }
36+
end
37+
group.run
38+
end
39+
40+
group.examples.each do |example|
41+
expect(example.metadata[:execution_result].status).to eq(:passed)
42+
end
43+
end
44+
2245
it "should define let blocks correctly" do
2346
group = nil
2447
sandboxed do

0 commit comments

Comments
 (0)