test/lib/eye/patch/settings_test.rb in eye-patch-0.3.0 vs test/lib/eye/patch/settings_test.rb in eye-patch-0.3.1
- old
+ new
@@ -8,8 +8,19 @@
file = Tempfile.new("yaml")
file.write("sum: <%= 1 + 2 %>")
file.close
assert_equal 3, Settings.new(file.path)[:sum]
end
+
+ it "exposes the config file's path within ERB" do
+ file = Tempfile.new("yaml")
+ file.write("working_dir: <%= __FILE__ %>/..")
+ file.close
+
+ assert_equal(
+ File.join(file.path, ".."),
+ Settings.new(file.path)[:working_dir],
+ )
+ end
end
end
end