🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

koine-test_runner

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koine-test_runner

0.4.0
Rubygems
Version published
Maintainers
1
Created
Source

TestRunner

Easy test runner customization

Build Status Coverage Status Code Climate Issue Count

Gem Version Dependency Status

Installation

Add this line to your application's Gemfile:

gem 'koine-test_runner'

And then execute:

$ bundle

Usage

# run tested code in line 55
bundle exec run_test some/file_spec.rb --line=55

# run the whole file
bundle exec run_test some/file.php

# unknown file
bundle exec run_test some/file_spec.custom
# => error: No test runner found for file 'some/file_spec.custom'

File Customization

# .test_runner.yml

adapters:
  rspec:
    adapter: rspec
    file_pattern: "*_spec.rb"

  phpunit:
    adapter: phpunit
    file_pattern: "*Test.php"

  jest:
    adapter: custom
    file_pattern: "client/.*.spec.js"
    command: "./node_modules/.bin/jest"
    commands:
      all: "{command}"
      file: "{command} {file}"
      # oops, jest does not really filter by line
      line: "{command} {file}"

  # TODO
  My::CustoAdapter:
    require:
      - some/file
    adapter: MyCustomAdapter
    suffix: '_spec.custom'
module My
  class CustomAdapter
    def initialize(suffix:)
      @suffix = suffix
    end

    # 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
    end
  end
end

Now you can run:

bundle exec run_test some/file_spec.custom

Running the last test

Either run a file that does not get caught by any adapter

bundle exec run_test some/file_spec.unkown # run last test

Or

bundle exec run_test --last

Checking the log

cat /tmp/test_runner.log

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.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mjacobus/test_runner. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 14 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

OSZAR »