Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom rpc_spec_path Configuration #18

Open
patrickbadleyupstart opened this issue Aug 26, 2022 · 1 comment
Open

Custom rpc_spec_path Configuration #18

patrickbadleyupstart opened this issue Aug 26, 2022 · 1 comment

Comments

@patrickbadleyupstart
Copy link

I tried to utilize a few variations of this code:

Gruf::Rspec.configure do |c|
  c.rpc_spec_path = '/spec/contract/'
end

but it doesn't seem to recognize the run_rpc method (or other gruf-rspec test methods) in my test unless I move the test file into spec/rpc.

Is this working correctly or am I missing something if I want to put these tests in a directory other than "rpc".

Could there also/alternatively be an option to specify a test as a gruf-controller test as opposed to putting them all in the same folder and assuming that every test in that folder is a controller test? Perhaps by extending a base class that defines the run_rpc method?

Thank you!

@Freubert
Copy link

Don't know if this is a bug, but this applies to my setup as well.

@patrickbadleyupstart you could use the following as a workaroud in your RSpec.configure block:

  config.define_derived_metadata(file_path: %r{/spec/contract}) do |metadata|
    metadata[:type] = :gruf_controller
  end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants