Update readme_examples_test.rb
This commit is contained in:
parent
543af297fa
commit
ac2428d7c5
1 changed files with 10 additions and 4 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue