From f441d11dcdb7b90649f2a91d1788c70154ecd428 Mon Sep 17 00:00:00 2001 From: Dmytro Stepaniuk Date: Mon, 8 May 2017 17:28:07 +0300 Subject: [PATCH] Replace hash rockets with new syntax (#802) * update rocket hash syntax in Guardfile * update rocket hash syntax in spec/dummy/lib/tasks/test.rake * update rocket hash syntax in lib/draper/tasks/test.rake * update rocket hash syntax in lib/generators/mini_test/decorator_generator.rb * update rocket hash syntax in schema from dummy app --- Guardfile | 10 +++++----- lib/draper/tasks/test.rake | 2 +- lib/generators/mini_test/decorator_generator.rb | 2 +- spec/dummy/db/schema.rb | 8 ++++---- spec/dummy/lib/tasks/test.rake | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Guardfile b/Guardfile index 2e6c3d7..2c1a566 100644 --- a/Guardfile +++ b/Guardfile @@ -1,25 +1,25 @@ def rspec_guard(options = {}, &block) options = { - :version => 2, - :notification => false + version: 2, + notification: false }.merge(options) guard 'rspec', options, &block end -rspec_guard :spec_paths => %w{spec/draper spec/generators} do +rspec_guard spec_paths: %w{spec/draper spec/generators} do watch(%r{^spec/.+_spec\.rb$}) watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } watch('spec/spec_helper.rb') { "spec" } end -rspec_guard :spec_paths => 'spec/integration', :env => {'RAILS_ENV' => 'development'} do +rspec_guard spec_paths: 'spec/integration', env: {'RAILS_ENV' => 'development'} do watch(%r{^spec/.+_spec\.rb$}) watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } watch('spec/spec_helper.rb') { "spec" } end -rspec_guard :spec_paths => 'spec/integration', :env => {'RAILS_ENV' => 'production'} do +rspec_guard spec_paths: 'spec/integration', env: {'RAILS_ENV' => 'production'} do watch(%r{^spec/.+_spec\.rb$}) watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } watch('spec/spec_helper.rb') { "spec" } diff --git a/lib/draper/tasks/test.rake b/lib/draper/tasks/test.rake index fbf31f1..f7c5318 100644 --- a/lib/draper/tasks/test.rake +++ b/lib/draper/tasks/test.rake @@ -2,7 +2,7 @@ require 'rake/testtask' require 'rails/test_unit/railtie' namespace :test do - Rake::TestTask.new(:decorators => "test:prepare") do |t| + Rake::TestTask.new(decorators: "test:prepare") do |t| t.libs << "test" t.pattern = "test/decorators/**/*_test.rb" end diff --git a/lib/generators/mini_test/decorator_generator.rb b/lib/generators/mini_test/decorator_generator.rb index cedea48..fa61f1a 100644 --- a/lib/generators/mini_test/decorator_generator.rb +++ b/lib/generators/mini_test/decorator_generator.rb @@ -7,7 +7,7 @@ module MiniTest File.expand_path('../templates', __FILE__) end - class_option :spec, :type => :boolean, :default => false, :desc => "Use MiniTest::Spec DSL" + class_option :spec, type: :boolean, default: false, desc: "Use MiniTest::Spec DSL" check_class_collision suffix: "DecoratorTest" diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb index fe5946e..9aebf2c 100644 --- a/spec/dummy/db/schema.rb +++ b/spec/dummy/db/schema.rb @@ -11,11 +11,11 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20121019115657) do +ActiveRecord::Schema.define(version: 20121019115657) do - create_table "posts", :force => true do |t| - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + create_table "posts", force: true do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end end diff --git a/spec/dummy/lib/tasks/test.rake b/spec/dummy/lib/tasks/test.rake index 56052a8..ac09958 100644 --- a/spec/dummy/lib/tasks/test.rake +++ b/spec/dummy/lib/tasks/test.rake @@ -13,4 +13,4 @@ RSpec::Core::RakeTask.new :fast_spec do |t| t.pattern = "fast_spec/**/*_spec.rb" end -task :default => [:test, :spec, :fast_spec] +task default: [:test, :spec, :fast_spec]