asciidoctor / asciidoctor-diagram

:left_right_arrow: Asciidoctor diagram extension, with support for AsciiToSVG, BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag), Ditaa, Erd, GraphViz, Mermaid, Msc, PlantUML, Shaape, SvgBob, Syntrax, UMLet, Vega, Vega-Lite and WaveDrom.
http://asciidoctor.org
MIT License
435 stars 106 forks source link

Add contributors guide how to run a single test #359

Closed ahus1 closed 3 years ago

ahus1 commented 3 years ago

When preparing PR #358, I struggled with running a single test of the big test suite locally.

This is probably due to me being a Ruby newbie. I tried to apply some things about running a single test from the Asciidoctor contributor's guide, but did work out. As a last resort I delete the tests I didn't want to run locally, and reverted that change before pushing the change.

I'd love to see a chapter in this project's contributors guide for this project about how to run a single test.

pepijnve commented 3 years ago

I usually do this from my IDE (RubyMine). From a shell it's a standard RSpec invocation. See below for instance:

pepijn@Cerris asciidoctor-diagram % bundle exec rspec spec/plantuml_spec.rb -e "plantuml should generate image blocks when format is set to 'png'"
Run options:
  include {:full_description=>/plantuml\ should\ generate\ image\ blocks\ when\ format\ is\ set\ to\ 'png'/}
  exclude {:broken_on_osx=>true}

Asciidoctor::Diagram::PlantUmlBlockMacroProcessor
  plantuml should generate image blocks when format is set to 'png'

Asciidoctor::Diagram::PlantUmlBlockProcessor
  plantuml should generate image blocks when format is set to 'png'

Finished in 1.64 seconds (files took 0.27539 seconds to load)
2 examples, 0 failures
pepijnve commented 3 years ago

See https://relishapp.com/rspec/rspec-core/v/3-10/docs/command-line/example-option for more detailed information.

ahus1 commented 3 years ago

Thanks, I'll use the suggested scripts and links next time.