Simplify tests

This commit is contained in:
Alex Kotov 2024-09-11 08:50:37 +04:00
parent cfae23580a
commit 4f5feacb12
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

17
test.rb
View file

@ -6,7 +6,7 @@ require 'open3'
EXE = File.expand_path('exe/referator', __dir__).freeze
RAW_REFS = {
REFS = {
self: {
foo: {
'category' => 'self',
@ -41,17 +41,6 @@ RAW_REFS = {
}.freeze,
}.freeze
REFS = {
self: {
foo: RAW_REFS[:self][:foo],
bar: RAW_REFS[:self][:bar],
}.freeze,
link: {
example_com: RAW_REFS[:link][:example_com],
causa_arcana_com: RAW_REFS[:link][:causa_arcana_com],
}.freeze,
}.freeze
workdir = File.expand_path('test', __dir__).freeze
@stdin, @stdout, @wait_thr = Open3.popen2 EXE, workdir, chdir: __dir__
@ -122,8 +111,8 @@ cmd :REGISTER_FORMAT, { name: :json, script: :render }
# REGISTER_REF #
################
cmd :REGISTER_REF, RAW_REFS[:self][:foo]
cmd :REGISTER_REF, RAW_REFS[:link][:example_com]
cmd :REGISTER_REF, REFS[:self][:foo]
cmd :REGISTER_REF, REFS[:link][:example_com]
cmd(:EXEC, 'conf_register_ref') { |result| raise unless result.nil? }