From a40fec41dfba4d176429b596124e3c18ebee53eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B8=D1=80=D0=B8=D0=BB=D0=BB=20=D0=9B=D0=B5=D0=BE?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2?= <71232234+leonovk@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:20:05 +0300 Subject: [PATCH] Moved the examples to the tests folder (#8) --- Gemfile | 1 + Gemfile.lock | 2 ++ {.examples => test/examples}/empty.yaml | 0 {.examples => test/examples}/example.yaml | 0 test/lib/active_yaml/base_model_test.rb | 2 +- test/lib/active_yaml/class_methods_test.rb | 2 +- test/lib/active_yaml/parser_test.rb | 2 +- test/lib/active_yaml_test.rb | 4 ++-- 8 files changed, 8 insertions(+), 5 deletions(-) rename {.examples => test/examples}/empty.yaml (100%) rename {.examples => test/examples}/example.yaml (100%) diff --git a/Gemfile b/Gemfile index 86d0a45..059f3b1 100644 --- a/Gemfile +++ b/Gemfile @@ -8,6 +8,7 @@ group :development do gem 'byebug' gem 'minitest' gem 'minitest-reporters' + gem 'rake' gem 'rubocop' gem 'rubocop-minitest' end diff --git a/Gemfile.lock b/Gemfile.lock index 873dc85..f22e665 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -27,6 +27,7 @@ GEM stringio racc (1.7.3) rainbow (3.1.1) + rake (13.1.0) regexp_parser (2.8.2) rexml (3.2.6) rubocop (1.57.2) @@ -57,6 +58,7 @@ DEPENDENCIES byebug minitest minitest-reporters + rake rubocop rubocop-minitest diff --git a/.examples/empty.yaml b/test/examples/empty.yaml similarity index 100% rename from .examples/empty.yaml rename to test/examples/empty.yaml diff --git a/.examples/example.yaml b/test/examples/example.yaml similarity index 100% rename from .examples/example.yaml rename to test/examples/example.yaml diff --git a/test/lib/active_yaml/base_model_test.rb b/test/lib/active_yaml/base_model_test.rb index bdaf41a..26fdecf 100644 --- a/test/lib/active_yaml/base_model_test.rb +++ b/test/lib/active_yaml/base_model_test.rb @@ -3,7 +3,7 @@ require_relative '../../test_helper' class SomeUser < ActiveYaml::BaseModel - yaml '.examples/example.yaml' + yaml 'test/examples/example.yaml' def some_method start.kek.lol diff --git a/test/lib/active_yaml/class_methods_test.rb b/test/lib/active_yaml/class_methods_test.rb index 2ffeceb..a258ce9 100644 --- a/test/lib/active_yaml/class_methods_test.rb +++ b/test/lib/active_yaml/class_methods_test.rb @@ -4,7 +4,7 @@ class SomeUser extend ActiveYaml::ClassMethods - yaml '.examples/example.yaml' + yaml 'test/examples/example.yaml' end module ActiveYaml diff --git a/test/lib/active_yaml/parser_test.rb b/test/lib/active_yaml/parser_test.rb index 8e15267..84da7ac 100644 --- a/test/lib/active_yaml/parser_test.rb +++ b/test/lib/active_yaml/parser_test.rb @@ -7,7 +7,7 @@ class ParserTest < Minitest::Test def test_parse expect_hash = { 'start' => { 'kek' => { 'lol' => 'text', 'cheburek' => 'cheburek', 'users' => %w[Kirill Ekaterina] } } } - result = Parser.parse('.examples/example.yaml') + result = Parser.parse('test/examples/example.yaml') assert_equal result, expect_hash end diff --git a/test/lib/active_yaml_test.rb b/test/lib/active_yaml_test.rb index 27e3705..c53efb1 100644 --- a/test/lib/active_yaml_test.rb +++ b/test/lib/active_yaml_test.rb @@ -6,8 +6,8 @@ # lib/active_yaml/factory_hash.rb class ActiveYamlTest < Minitest::Test def setup - @test_data = ActiveYaml.create('.examples/example.yaml') - @test_empty_data = ActiveYaml.create('.examples/empty.yaml') + @test_data = ActiveYaml.create('test/examples/example.yaml') + @test_empty_data = ActiveYaml.create('test/examples/empty.yaml') end # rubocop:disable Naming/VariableNumber