Skip to content

Commit 56227a4

Browse files
francesmcmullineregon
authored andcommitted
Improve ancestor classes spec
1 parent 56fd240 commit 56227a4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

‎spec/concurrent/struct_shared.rb‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@
2727
end
2828

2929
it'ignores methods on ancestor classes'do
30-
ancestor=described_class.ancestors.first
31-
ancestor.class_eval{deffoo;end}
30+
ancestor=described_class.ancestors.last
31+
ancestor.class_eval{deffoo(bar);end}
3232

3333
clazz=described_class.new(:foo)
34-
expect{described_class.const_get(clazz.to_s)}.toraise_error(NameError)
35-
expect(clazz).tobe_aClass
36-
expect(clazz.ancestors).toincludedescribed_class
34+
struct=clazz.new
35+
36+
expect(struct).torespond_to:foo
37+
method=struct.method(:foo)
38+
expect(method.arity).toeq0
3739

3840
ancestor.send:remove_method,:foo
3941
end

0 commit comments

Comments
(0)