69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
# File 'lib/rspec-apigen/apigen.rb', line 69
def static_methods(&block)
clazz = describes
describe "Public Static Methods" do
static_context = Method.new
def_methods = clazz.public_methods - Object.methods + %w[new]
current_context = self
def_methods.each do |meth_name|
MetaHelper.create_singleton_method(static_context, meth_name) do |*args, &example_group|
current_context.subject { clazz }
current_context.create_scenarios_for(meth_name, :args => args, &example_group)
end
end
static_context.instance_eval(&block)
end
end
|