Rakefile in rbs-1.0.0 vs Rakefile in rbs-1.0.1
- old
+ new
@@ -26,12 +26,10 @@
task :validate => :parser do
sh "#{ruby} #{rbs} validate --silent"
FileList["stdlib/*"].each do |path|
- next if path =~ %r{stdlib/builtin}
-
lib = [File.basename(path).to_s]
if lib == ["bigdecimal-math"]
lib << "bigdecimal"
end
@@ -82,10 +80,11 @@
sh "racc -v -o lib/rbs/parser.rb lib/rbs/parser.y"
sh "git diff --exit-code lib/rbs/parser.rb"
end
namespace :generate do
+ desc "Generate a test file for a stdlib class signatures"
task :stdlib_test, [:class] do |_task, args|
klass = args.fetch(:class) do
raise "Class name is necessary. e.g. rake 'generate:stdlib_test[String]'"
end
@@ -113,11 +112,11 @@
def call
ERB.new(<<~ERB, trim_mode: "-").result(binding)
require_relative "test_helper"
<%- unless class_methods.empty? -%>
- class <%= klass %>SingletonTest < Minitest::Test
+ class <%= klass %>SingletonTest < Test::Unit::TestCase
include TypeAssertions
# library "pathname", "set", "securerandom" # Declare library signatures to load
testing "singleton(::<%= klass %>)"
@@ -131,10 +130,10 @@
<%- end -%>
end
<%- end -%>
<%- unless instance_methods.empty? -%>
- class <%= klass %>Test < Minitest::Test
+ class <%= klass %>Test < Test::Unit::TestCase
include TypeAssertions
# library "pathname", "set", "securerandom" # Declare library signatures to load
testing "::<%= klass %>"