diff --git a/httpsensible.gemspec b/httpsensible.gemspec index ffb352d..78849ee 100644 --- a/httpsensible.gemspec +++ b/httpsensible.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency("httpx", "~> 0.24") + spec.add_dependency("httpx", ">= 0.24", "< 2.0") spec.add_dependency("jwt", "~> 2.7") spec.add_development_dependency("minitest", "~> 5.6") diff --git a/script/ci b/script/ci new file mode 100755 index 0000000..223430d --- /dev/null +++ b/script/ci @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +export CI=true + +script/test diff --git a/script/test b/script/test new file mode 100755 index 0000000..e449dbf --- /dev/null +++ b/script/test @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +#/ Usage: script/test +#/ 1. `script/test FILE` runs all tests in the file. +#/ 1. `script/test FILE:LINE` runs test in specific line of the file. +#/ 1. `script/test 'GLOB'` runs all tests for matching glob. +#/ * make sure to wrap the `GLOB` in single quotes `''`. + +if ! [ $# -eq 0 ]; then + export TEST=$(echo "$1" | cut -d ":" -f 1) + + if [[ "$1" == *":"* ]]; then + LINE=$(echo "$1" | cut -d ":" -f 2) + LINE=$(head -n $LINE $TEST | tail -1) + NAME=$(echo "$LINE" | sed "s/.*def //") + + if ! [[ "$NAME" == "test_"* ]]; then + echo + echo "ERROR: Line provided does not define a test case" + exit 1 + fi + + export TESTOPTS="--name=$NAME" + fi +fi + +bundle exec rake test