From 2c6aa5878d052abb77c6d119e1c2e2110118a244 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 21 Feb 2017 21:25:25 +0000 Subject: t/t0012-reload-empty-config.sh: access ivars directly if needed We'll be moving to direct ivar access to reduce the API (and method entry) overhead of internal unicorn classes. This means some tests like this one will reach deeper into internals. This will be necessary for the upcoming changes to add new configuration options to unicorn. --- t/t0012-reload-empty-config.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/t0012-reload-empty-config.sh b/t/t0012-reload-empty-config.sh index 81e1fb3..47d18ce 100755 --- a/t/t0012-reload-empty-config.sh +++ b/t/t0012-reload-empty-config.sh @@ -18,7 +18,8 @@ after_fork { |s,w| } next if key =~ %r{\Astd(?:err|out)_path\z} key = key.to_sym def_value = defaults[key] - srv_value = srv.__send__(key) + srv_value = srv.respond_to?(key) ? srv.__send__(key) + : srv.instance_variable_get("@#{key}") fp << "#{key}|#{srv_value}|#{def_value}\\n" end } -- cgit v1.2.3-24-ge0c7