README.md in koine-test_runner-0.1.0.pre.delete vs README.md in koine-test_runner-0.1.1

- old
+ new

@@ -1,12 +1,11 @@ # TestRunner Easy test runner customization -[![Build Status](https://travis-ci.org/mjacobus/test_runner.svg?branch=master)](https://travis-ci.org/mjacobus/koine-test_runner) +[![Build Status](https://travis-ci.org/mjacobus/test_runner.svg?branch=master)](https://travis-ci.org/mjacobus/test_runner) [![Coverage Status](https://coveralls.io/repos/github/mjacobus/test_runner/badge.svg?branch=master)](https://coveralls.io/github/mjacobus/test_runner?branch=master) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mjacobus/test_runner/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mjacobus/test_runner/?branch=master) [![Code Climate](https://codeclimate.com/github/mjacobus/test_runner/badges/gpa.svg)](https://codeclimate.com/github/mjacobus/test_runner) [![Issue Count](https://codeclimate.com/github/mjacobus/test_runner/badges/issue_count.svg)](https://codeclimate.com/github/mjacobus/test_runner) [![Gem Version](https://badge.fury.io/rb/koine-test_runner.svg)](https://badge.fury.io/rb/koine-test_runner) [![Dependency Status](https://gemnasium.com/badges/github.com/mjacobus/test_runner.svg)](https://gemnasium.com/github.com/mjacobus/test_runner) @@ -32,11 +31,11 @@ # run the whole file bundle exec run_test some/file.php # unknown file -bundle exec run_test some/file_spec.custom +bundle exec run_test some/file_spec.custom # => error: No test runner found for file 'some/file_spec.custom' ``` ### File Customization @@ -74,30 +73,37 @@ class CustomAdapter def initialize(suffix:) @suffix = suffix end - def matches?(file_path) - file_path.end_with?(@suffix) - end - - def test_command_for_file(file_path: line: nil) - cmd = ["/usr/bin/my_test --file=#{file_path}"] - - if line - cmd << "--line=#{line}" + # return nil if you do not want to deal with it + def test_command(config) + if config.file_path.end_with?(@suffix) + return "./bin/test #{config.file_path}" end - - cmd.join(' ') end end end ``` Now you can run: ```bash bundle exec run_test some/file_spec.custom +``` + +## Running the last test + +Either run a file that does not get caught by any adapter + +```bash +bundle exec run_test some/file_spec.unkown # run last test +``` + +Or + +```bash +bundle exec run_test --last ``` ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.