| name | testing |
|---|---|
| description | Use when writing or fixing RSpec tests, mocks, fixtures, SimpleCov filters, or WebMock usage in this repo. |
- Adding coverage for a new code path in
lib/ - Debugging a failing spec in
spec/ - Adjusting SimpleCov scope or shared test helpers
- RSpec is the test framework;
spec/spec_helper.rbloads SimpleCov, thencontentstack_utils, mocks, and support files - Default task:
bundle exec rakerunsspecwith--format documentation(seeRakefile)
spec/lib/— primary examples (utils_spec.rb,model/option_spec.rb,model/metadata_spec.rb)spec/mock/— constants and custom option subclasses used across examplesspec/support/— helpers (e.g. XML/JSON fixture builders likegetGQLJSONRTE)
- SimpleCov starts in
spec_helper.rband filtersspec/andlib/contentstack_utils/supportfrom coverage metrics - Aim to cover both HTML
render_contentpaths and JSON / GQLjson_to_htmlbranches when changingutils.rb
- webmock is a development dependency; stub outbound HTTP if future tests introduce network calls (current suite is largely pure parsing/rendering)
- Do not add real API keys, delivery tokens, or stack secrets to the repo; use fixture hashes and constants as in
spec/mock/andspec/support/constant.rb