diff options
author | Eivind Uggedal <eu@eju.no> | 2019-05-10 14:38:43 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-06-05 20:28:49 +0000 |
commit | 34946f61eaeb76cbd71bc5f44e83998290612807 (patch) | |
tree | e37279468cd6baa7d0d90e98ad17c0aca0521688 /testing/ruby-ttytest | |
parent | efbb2ad329df4b52c46da3730dafdd3cf85df86e (diff) | |
download | aports-34946f61eaeb76cbd71bc5f44e83998290612807.tar.bz2 aports-34946f61eaeb76cbd71bc5f44e83998290612807.tar.xz |
testing/ruby-ttytest: new aport
Required to run fzy's acceptance tests
Diffstat (limited to 'testing/ruby-ttytest')
-rw-r--r-- | testing/ruby-ttytest/APKBUILD | 43 | ||||
-rw-r--r-- | testing/ruby-ttytest/fix-flaky-test.patch | 12 | ||||
-rw-r--r-- | testing/ruby-ttytest/gemspec.patch | 13 | ||||
-rw-r--r-- | testing/ruby-ttytest/skip-yard.patch | 26 |
4 files changed, 94 insertions, 0 deletions
diff --git a/testing/ruby-ttytest/APKBUILD b/testing/ruby-ttytest/APKBUILD new file mode 100644 index 0000000000..925a4ab81e --- /dev/null +++ b/testing/ruby-ttytest/APKBUILD @@ -0,0 +1,43 @@ +# Maintainer: Eivind Uggedal <eu@eju.no> +pkgname=ruby-ttytest +_gemname=ttytest +pkgver=0.5.0 +pkgrel=0 +pkgdesc="Acceptance test framework for interactive console applications" +url="https://github.com/jhawthorn/ttytest" +arch="noarch" +license="MIT" +depends="ruby tmux" +checkdepends="ruby-minitest ruby-rake ruby-bundler" +source="$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz + skip-yard.patch + fix-flaky-test.patch + gemspec.patch" +builddir="$srcdir/$_gemname-$pkgver" + +build() { + gem build $_gemname.gemspec +} + +check() { + rake test +} + +package() { + local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')" + + gem install --local \ + --install-dir "$gemdir" \ + --ignore-dependencies \ + --no-document \ + --verbose \ + $_gemname + + # Cleanup: + cd "$gemdir" + rm -r cache build_info doc +} +sha512sums="30b9f41c8da691178dc9cee66e6fe75c57b3536408d75a6667c1436772103a296e0ec01b2d819592241601e2deae8ebb098a52267fe0e740a35bc039af626fe7 ruby-ttytest-0.5.0.tar.gz +9986cc16c5c30a11cdb92f8d93159bb06dbbc125e1e839d3438b60baabb15b062326116e7e42b9f289a671d91d3f67b90b4f149e0fd86c56b59365b0b36ac4e6 skip-yard.patch +6f1e61c958b754fa2d292c486a366122402a20769156d6a251be47f5cc830ac62d88b70e6dd9984d467dbd87ab103625cec1b7e1f369fc60f7263de887250d60 fix-flaky-test.patch +23dbf425ba8733c6ee91a3809ffab97ec934d1c8c9269105b04bb8b1c3e942cfef417a9ce303e4d5d607d01cb52c83098d0a6c5ddd79aa83274406bbd188704a gemspec.patch" diff --git a/testing/ruby-ttytest/fix-flaky-test.patch b/testing/ruby-ttytest/fix-flaky-test.patch new file mode 100644 index 0000000000..80bc097e45 --- /dev/null +++ b/testing/ruby-ttytest/fix-flaky-test.patch @@ -0,0 +1,12 @@ +--- ttytest-0.5.0/test/ttytest/terminal_test.rb ++++ ttytest-0.5.0_p/test/ttytest/terminal_test.rb +@@ -4,6 +4,9 @@ + class TerminalTest < Minitest::Test + def test_shell_hello_world + @tty = TTYtest.new_terminal(%{PS1='$ ' /bin/sh}) ++ # Give tmux some time to settle ++ # (see https://github.com/jhawthorn/ttytest/issues/2): ++ sleep(0.5) + @tty.assert_row(0, '$') + @tty.send_keys('echo "Hello, world"') + @tty.assert_row(0, '$ echo "Hello, world"') diff --git a/testing/ruby-ttytest/gemspec.patch b/testing/ruby-ttytest/gemspec.patch new file mode 100644 index 0000000000..c9e8ca63bb --- /dev/null +++ b/testing/ruby-ttytest/gemspec.patch @@ -0,0 +1,13 @@ +--- ttytest-0.5.0/ttytest.gemspec ++++ ttytest-0.5.0_p/ttytest.gemspec +@@ -14,9 +14,7 @@ + spec.homepage = "https://github.com/jhawthorn/ttytest" + spec.license = "MIT" + +- spec.files = `git ls-files -z`.split("\x0").reject do |f| +- f.match(%r{^(test|spec|features)/}) +- end ++ spec.files = Dir["lib/**/*"] + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] diff --git a/testing/ruby-ttytest/skip-yard.patch b/testing/ruby-ttytest/skip-yard.patch new file mode 100644 index 0000000000..fce69a1332 --- /dev/null +++ b/testing/ruby-ttytest/skip-yard.patch @@ -0,0 +1,26 @@ +--- ttytest-0.5.0/Rakefile ++++ ttytest-0.5.0_p/Rakefile +@@ -1,15 +1,10 @@ + require "bundler/gem_tasks" + require "rake/testtask" +-require "yard" + + Rake::TestTask.new(:test) do |t| + t.libs << "test" + t.libs << "lib" + t.test_files = FileList['test/**/*_test.rb'] +-end +- +-YARD::Rake::YardocTask.new do |t| +- t.files = ['lib/**/*.rb'] + end + + task :console do +--- ttytest-0.5.0/ttytest.gemspec ++++ ttytest-0.5.0_p/ttytest.gemspec +@@ -26,5 +26,4 @@ + spec.add_development_dependency "bundler", "~> 1.7" + spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "minitest", "~> 5.0" +- spec.add_development_dependency "yard" + end |