Skip to content

Commit

Permalink
Merge pull request #921 from cucumber/fix-minitest-scenario
Browse files Browse the repository at this point in the history
Fix minitest setup code and make minitest support scenarios run at least one test
  • Loading branch information
mvz authored Apr 1, 2024
2 parents 41129ec + 45b1a87 commit 92306fb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ Feature: Supported Testing Frameworks
include Aruba::Api
def setup
aruba_setup
setup_aruba
end
def getting_started_with_aruba
def test_getting_started_with_aruba
file = 'file.txt'
content = 'Hello World'
write_file file, content
read(file).must_equal [content]
assert_equal [content], read(file)
end
end
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Feature: Initialize project with aruba
When I successfully run `ruby -Ilib:test test/use_aruba_with_minitest.rb`
Then the output should contain:
"""
0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
1 runs, 0 assertions, 0 failures, 0 errors, 1 skips
"""

Scenario: Unknown Test Framework
Expand Down
45 changes: 13 additions & 32 deletions lib/aruba/initializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Aruba
#
# Initialize project with aruba configuration files
module Initializers
#
# Common initializer
#
# @private
Expand Down Expand Up @@ -35,14 +36,9 @@ def add_gem
send creator, file, content
end
end
end
end

# Aruba
module Aruba
# Initializers
module Initializers
# Default Initializer
#
# Failing Initializer
#
# This handles invalid values for initializer.
#
Expand All @@ -59,14 +55,8 @@ def start(*)
end
end
end
end
end

# Aruba
module Aruba
# Initializer
module Initializers
# Add aruba + rspec to project
# RSpec Initializer. Adds aruba + rspec to project
#
# @private
class RSpecInitializer < Thor::Group
Expand Down Expand Up @@ -100,14 +90,9 @@ def create_support_file
EOS
end
end
end
end

# Aruba
module Aruba
# Initializer
module Initializers
# Add aruba + aruba to project
#
# Cucumber Initializer. Adds Aruba + Cucumber to project
#
# @private
class CucumberInitializer < Thor::Group
Expand All @@ -125,14 +110,9 @@ def create_support_file
EOS
end
end
end
end

# Aruba
module Aruba
# Initializer
module Initializers
# Add aruba + minitest to project
#
# Minitest Initializer. Adds Aruba + Minitest to project
#
# @private
class MiniTestInitializer < Thor::Group
Expand Down Expand Up @@ -172,17 +152,18 @@ class FirstRun < Minitest::Test
include Aruba::Api
def setup
aruba_setup
setup_aruba
end
def test_dummy
skip "Add some real tests here"
end
end
EOS
end
end
end
end

# Aruba
module Aruba
# The whole initializer
#
# This one uses the specific initializers to generate the needed files.
Expand Down

0 comments on commit 92306fb

Please sign in to comment.