Class: MSpecRun
- Inherits:
-
MSpecScript
- Object
- MSpecScript
- MSpecRun
- Defined in:
- lib/mspec/commands/mspec-run.rb
Instance Method Summary collapse
-
#initialize ⇒ MSpecRun
constructor
A new instance of MSpecRun.
- #options(argv = ARGV) ⇒ Object
- #run ⇒ Object
Methods inherited from MSpecScript
config, #config, #custom_options, #custom_register, #entries, #files, get, #load, #load_default, main, #register, set, #signals
Constructor Details
#initialize ⇒ MSpecRun
Returns a new instance of MSpecRun.
11 12 13 14 15 |
# File 'lib/mspec/commands/mspec-run.rb', line 11 def initialize super config[:files] = [] end |
Instance Method Details
#options(argv = ARGV) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/mspec/commands/mspec-run.rb', line 17 def (argv=ARGV) = MSpecOptions.new "mspec run [options] (FILE|DIRECTORY|GLOB)+", 30, config .doc " Ask yourself:" .doc " 1. What specs to run?" .doc " 2. How to modify the execution?" .doc " 3. How to modify the guard behavior?" .doc " 4. How to display the output?" .doc " 5. What action to perform?" .doc " 6. When to perform it?" .doc "\n What specs to run" .filters .doc "\n How to modify the execution" .chdir .prefix .configure { |f| load f } .name .randomize .pretend .background .interrupt .doc "\n How to modify the guard behavior" .unguarded .verify .doc "\n How to display their output" .formatters .verbose .doc "\n What action to perform" .actions .doc "\n When to perform it" .action_filters .doc "\n Help!" .debug .version MSpec::VERSION .help .doc "\n Custom options" .doc "\n How might this work in the real world?" .doc "\n 1. To simply run some specs" .doc "\n $ mspec path/to/the/specs" .doc " mspec path/to/the_file_spec.rb" .doc "\n 2. To run specs tagged with 'fails'" .doc "\n $ mspec -g fails path/to/the_file_spec.rb" .doc "\n 3. To start the debugger before the spec matching 'this crashes'" .doc "\n $ mspec --spec-debug -S 'this crashes' path/to/the_file_spec.rb" .doc "" patterns = .parse argv patterns = config[:files] if patterns.empty? if patterns.empty? puts puts "No files specified." exit 1 end @files = files patterns end |