From 1e0a0bc66a0cd7fa98ef89ad7abd1f0f8cff6290 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sun, 10 Sep 2023 02:07:43 +0300 Subject: [PATCH] Replace `File.expand_path` with simple `__dir__` interpolation --- Rakefile | 5 +---- spec/lib/telegram/bot/types_spec.rb | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Rakefile b/Rakefile index afb5a65a..e615f56f 100644 --- a/Rakefile +++ b/Rakefile @@ -55,8 +55,5 @@ task :dump_type_attributes do end # Write everything to fixture file - File.write( - File.expand_path('spec/support/type_attributes.yml', __dir__), - result.to_yaml - ) + File.write "#{__dir__}/spec/support/type_attributes.yml", result.to_yaml end diff --git a/spec/lib/telegram/bot/types_spec.rb b/spec/lib/telegram/bot/types_spec.rb index ad6de703..f3119aef 100644 --- a/spec/lib/telegram/bot/types_spec.rb +++ b/spec/lib/telegram/bot/types_spec.rb @@ -2,9 +2,7 @@ require 'yaml' -type_attributes = YAML.safe_load( - File.read(File.expand_path('../../../support/type_attributes.yml', __dir__)) -) +type_attributes = YAML.safe_load File.read("#{__dir__}/../../../support/type_attributes.yml") RSpec.describe Telegram::Bot::Types do type_attributes.each do |type, attributes|