Class: Mrubyc::Test::Tool
Instance Method Summary collapse
- #help(arg = nil) ⇒ Object
- #init ⇒ Object
- #test(testfilepath = "test/*.rb") ⇒ Object
- #version ⇒ Object
Instance Method Details
#help(arg = nil) ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/mrubyc-test.rb', line 110 def help(arg = nil) super(arg) init_env if arg == "test" puts puts "Default environment variables you can change:" puts " CFLAGS='#{ENV['CFLAGS']}'" puts " LDFLAGS='#{ENV['LDFLAGS']}'" puts end exit if arg puts "\e[33m Note:" puts ' It is recommended to use mrubyc-utils as a wrapper of this gem' puts ' see https://github.com/hasumikin/mrubyc-utils#wrapper-of-gem-mrubyc-test-and-mrubyc-debugger' puts "\e[0m" end |
#test(testfilepath = "test/*.rb") ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/mrubyc-test.rb', line 91 def test(testfilepath = "test/*.rb") init_env method_name_pattern = (%r{\A/(.*)/\Z} =~ [:name] ? Regexp.new($1) : [:name]) test_path = if testfilepath == "" File.join(Dir.pwd, config['test_dir'], "*.rb") else File.join(Dir.pwd, testfilepath) end Dir.glob(test_path).each_slice([:every]) do |test_files| prepare(test_files, [:verbose], method_name_pattern) make end end |