Skip to content

Commit

Permalink
Merge pull request #173 from yoshiori/add_rspec_plugin
Browse files Browse the repository at this point in the history
add rspec plugin
  • Loading branch information
yoshiori authored Mar 22, 2021
2 parents 6403b36 + 27517ac commit eab8c10
Show file tree
Hide file tree
Showing 6 changed files with 451 additions and 1 deletion.
2 changes: 1 addition & 1 deletion launchable/test_runners/minitest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def parse(fname: str):
parse(l)
else:
# assume it's a file
client.test(fname)
client.test_path(fname)

for f in files:
parse(f)
Expand Down
35 changes: 35 additions & 0 deletions launchable/test_runners/rspec.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import click
import os
import sys
from . import launchable


@click.argument('files', required=True, nargs=-1)
@launchable.subset
def subset(client, files):
def parse(fname: str):
'''
Scan a file, directory full of *.rb, or @FILE
'''
if os.path.isdir(fname):
client.scan(fname, '**/*_spec.rb')
elif fname == '@-':
# read stdin
for l in sys.stdin:
parse(l)
elif fname.startswith('@'):
# read response file
with open(fname[1:]) as f:
for l in f:
parse(l)
else:
# assume it's a file
client.test_path(fname)

for f in files:
parse(f)

client.run()


record_tests = launchable.CommonRecordTestImpls(__name__).report_files()
Loading

0 comments on commit eab8c10

Please sign in to comment.