Rails 4 / RSpec - Create my own custom arguments to pass to include/exclude certain tests from running? -
my app uses braintree process payments. unfortunately fake_braintree gem depreciated current braintree api, forced hit braintree sandbox servers tests, extremely slow (if can issue or recommend alternative, that'd awesome too).
my question is, group or tag tests hit braintree servers, , not run them default, , specify argument run tests including those? ideally i'd want 'rspec' command skip tests, , running 'rspec --include-braintree' run tests, including ones hit braintree servers.
i feel happy medium don't sit around waiting on external api calls every time run test suite.
yes, can use:
# spec/spec_helper.rb rspec.configure |config| config.filter_run_excluding braintree: true unless env['braintree'] end
mark test tag (or entire block if want):
it "does stuff", braintree: true end
and can do: braintree=1 rspec
run tests including braintree tests
Comments
Post a Comment