Class: PolishGeeks::DevTools::Commands::Rspec
- Defined in:
- lib/polish_geeks/dev_tools/commands/rspec.rb
Overview
Command wrapper for Rspec validation It informs us if our specs are working in a proper way
Constant Summary collapse
- EXAMPLES_REGEXP =
Regexp used to match Rspec examples count
/(\d+) examples/
- FAILURES_REGEXP =
Regexp used to match Rspec failures
/(\d+) failure/
- PENDING_REGEXP =
Regexp used to match Rspec pendings
/(\d+) pending/
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#execute ⇒ String
Executes this command.
-
#label ⇒ String
Default label for this command.
-
#valid? ⇒ Boolean
True if there were no Rspec failures, false otherwise.
Methods inherited from Base
#ensure_executable!, #error_message
Instance Method Details
#execute ⇒ String
Executes this command
18 19 20 |
# File 'lib/polish_geeks/dev_tools/commands/rspec.rb', line 18 def execute @output = Shell.new.execute('bundle exec rspec spec') end |
#label ⇒ String
Returns default label for this command.
28 29 30 |
# File 'lib/polish_geeks/dev_tools/commands/rspec.rb', line 28 def label "Rspec (#{examples_count} ex, #{failures_count} fa, #{pending_count} pe)" end |
#valid? ⇒ Boolean
Returns true if there were no Rspec failures, false otherwise.
23 24 25 |
# File 'lib/polish_geeks/dev_tools/commands/rspec.rb', line 23 def valid? failures_count.zero? && disallow_pending_valid? end |