From 948f6265ca4a5aa187bf7e76f93dd275b1568b0d Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Thu, 30 Nov 2023 11:51:30 +0000 Subject: [PATCH] feat: Bump Ruby version to 3.1 (#30) * feat: Bump Ruby version to 3.1 Signed-off-by: Dan Webb * feat: Bump Ruby version to 3.1 Signed-off-by: Dan Webb --------- Signed-off-by: Dan Webb --- .tool-versions | 2 +- Gemfile | 2 +- features/plugin_install_command.feature | 14 ++++++++ features/plugin_list_command.feature | 8 +++++ features/support/env.rb | 18 ++++++++++ features/test_command.feature | 44 +++++++++++++++++++++++++ 6 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 features/plugin_install_command.feature create mode 100644 features/plugin_list_command.feature create mode 100644 features/support/env.rb create mode 100644 features/test_command.feature diff --git a/.tool-versions b/.tool-versions index 9eb38ed..f2a971a 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -ruby 2.7.2 +ruby 3.2.2 diff --git a/Gemfile b/Gemfile index 78f03a5..92a9693 100644 --- a/Gemfile +++ b/Gemfile @@ -11,10 +11,10 @@ end group :test do gem "rake", ">= 11.0" gem "rspec", "~> 3.2" + gem "aruba" end group :development do - gem "aruba" gem "countloc" gem "simplecov" diff --git a/features/plugin_install_command.feature b/features/plugin_install_command.feature new file mode 100644 index 0000000..cdb2782 --- /dev/null +++ b/features/plugin_install_command.feature @@ -0,0 +1,14 @@ +Feature: Plugin install command + In order to use this plugin + As a user of Busser + I want to run the postinstall for this plugin + + Background: + Given a test BUSSER_ROOT directory named "busser-bats-install" + + Scenario: Running the postinstall generator + When I run `busser plugin install busser-bats --force-postinstall` + # Then the vendor directory named "bats" should exist + # Then the vendor file "bats/bin/bats" should contain "BATS_PREFIX=" + And the output should contain "Installed Bats" + And the exit status should be 0 diff --git a/features/plugin_list_command.feature b/features/plugin_list_command.feature new file mode 100644 index 0000000..b387188 --- /dev/null +++ b/features/plugin_list_command.feature @@ -0,0 +1,8 @@ +Feature: Plugin list command + In order to use this plugin + As a user of Busser + I want to see this plugin in the 'busser plugin list' command + + Scenario: Plugin appears in plugin list command + When I successfully run `busser plugin list` + Then the output should match /^bats\b/ diff --git a/features/support/env.rb b/features/support/env.rb new file mode 100644 index 0000000..8001f96 --- /dev/null +++ b/features/support/env.rb @@ -0,0 +1,18 @@ +require "aruba/cucumber" +require "busser/cucumber" + +if ENV["COVERAGE"] + require "simplecov" + SimpleCov.command_name "features" +end + +Before do + @aruba_timeout_seconds = 20 +end + +After do |s| + # Tell Cucumber to quit after this scenario is done - if it failed. + # This is useful to inspect the 'tmp/aruba' directory before any other + # steps are executed and clear it out. + Cucumber.wants_to_quit = true if s.failed? +end diff --git a/features/test_command.feature b/features/test_command.feature new file mode 100644 index 0000000..42f862b --- /dev/null +++ b/features/test_command.feature @@ -0,0 +1,44 @@ +Feature: Test command + In order to run tests written with bats + As a user of Busser + I want my tests to run when the bats runner plugin is installed + + Background: + Given a test BUSSER_ROOT directory named "busser-bats-test" + When I successfully run `busser plugin install busser-bats --force-postinstall` + Given a suite directory named "bats" + +# Scenario: A passing test suite + # Given a file in suite "bats" named "default.bats" with: + # """ + # @test "runs something" { + # run echo "hello" + # [ "$status" -eq 0 ] + # [ "$output" == "hello" ] + # } + + # """ + # When I run `busser test bats` + # Then the output should contain: + # """ + # 1..1 + # ok 1 runs something + # """ + # And the exit status should be 0 + +# Scenario: A failing test suite +# Given a file in suite "bats" named "default.bats" with: +# """ +# @test "fails something" { +# run which uhoh-whatzit-called +# [ "$status" -eq 0 ] +# } + +# """ +# When I run `busser test bats` +# Then the output should contain: +# """ +# 1..1 +# not ok 1 fails something +# """ +# And the exit status should not be 0