Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion test/test_configdsl.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require_relative 'helper'
require 'fluent/config/dsl'
require 'fluent/test'
require 'tempfile'

class ConfigDSLTest < Test::Unit::TestCase
# TEST_CONFIG1 = %[
Expand Down Expand Up @@ -107,8 +108,12 @@ def test_config_error

def test_with_ruby_keyword
uname_string = `uname -a`
tmpfile = Tempfile.create('fluentd-test')
tmpfile.write(uname_string)
tmpfile.close

root1 = Fluent::Config::DSL::Parser.parse(<<DSL)
uname_str = ruby.open('|uname -a'){|out| out.read}
uname_str = ruby.open("#{tmpfile.path}"){|out| out.read}
source {
uname uname_str
}
Expand Down Expand Up @@ -144,5 +149,7 @@ def test_with_ruby_keyword
}
DSL
assert_raise (NoMethodError) { Fluent::Config::DSL::Parser.parse(conf3) }
ensure
File.delete(tmpfile.path)
end
end