From 83ddb9a56782a0fa97236289ab9db0e36699bc84 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Thu, 12 Jan 2017 11:42:40 +0900 Subject: Refactor --- Rakefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 472f676..cc8bfb1 100644 --- a/Rakefile +++ b/Rakefile @@ -4,14 +4,14 @@ require 'yaml' spec_tasks = [] configs = {} -tests = Dir.glob("spec/*/").map { |s| s.gsub(/spec\//, '').gsub(/\//, '') } +tests = Dir.glob('spec/*/').map { |s| s.gsub(%r{spec/}, '').gsub(%r{/}, '') } tests.each do |test| spec_tasks.concat(["spec:#{test}"]) configs[test] = YAML.load_file("spec/#{test}/config.yaml") end -task :spec => spec_tasks -task :all => "spec:all" +task spec: spec_tasks +task all: 'spec:all' namespace :spec do tests.each do |test| @@ -39,8 +39,8 @@ namespace :spec do Dir.chdir("spec/#{test}") do config.keys.each do |host| RSpec::Core::RakeTask.new(host.to_sym) do |t| - ENV["TARGET_TEST"] = test - ENV["TARGET_HOST"] = host + ENV['TARGET_TEST'] = test + ENV['TARGET_HOST'] = host t.pattern = "spec/#{test}/#{host}_spec.rb" end end -- cgit v1.2.3