Update readme_examples_test.rb

This commit is contained in:
0x1eef 2024-05-12 01:32:20 -03:00
parent 543af297fa
commit ac2428d7c5

View file

@ -6,10 +6,16 @@ class ReadmeExamplesTest < Test::Unit::TestCase
require "rbconfig" require "rbconfig"
require "test/cmd" require "test/cmd"
def test_available_features def test_available_features_success
result = cmd(RbConfig.ruby, readme_example("1_available_features.rb")) assert_equal true,
assert_equal true, result.status.success? cmd(RbConfig.ruby, readme_example("1_available_features.rb"))
result.each_line { assert_match %r{The [a-zA-Z0-9_]+ feature is available}, _1 } .status.success?
end
def test_available_features_stdout
cmd(RbConfig.ruby, readme_example("1_available_features.rb"))
.stdout
.each_line { assert_match %r{The [a-zA-Z0-9_]+ feature is available}, _1 }
end end
private private