Hi
# spec/support/generate_test_cases.rb
module RSpec
module GenerateTestCases
def generate_test_cases
TestGenerator.new.generate_test_cases
end
class TestGenerator < RSpec::Core::ExampleGroup
def generate_test_cases
3.times do
TestGenerator.describe "Test Cases" do
example do
expect(1+1).to eq(2)
end
end
end
end
end
end
end
RSpec.configure do |rspec|
rspec.extend RSpec::GenerateTestCases
end
RSpec::SharedContext.send(:include, RSpec::GenerateTestCases)
# spec/models/user_spec.rb
RSpec.describe "User" do
generate_test_cases
end
When I run above test cases it shows 0 examples to run. What I am doing
wrong? How can I generate multiple test cases? Could help me?
Thanks in advance.
~
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/cb8b6886-7f33-4dab-870d-73495262c792%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.