Sha256: 38382b30ca0a253a6cb2fec655d38f9590d76ed0d1640326c8b739d500723c6a

Contents?: true

Size: 624 Bytes

Versions: 6

Compression:

Stored size: 624 Bytes

Contents

require_relative "../../../test_helper"
require "tempfile"

module Eye
  module Patch
    describe Settings do
      it "evaluates the yaml as ERB" do
        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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
eye-patch-0.5.1 test/lib/eye/patch/settings_test.rb
eye-patch-0.5.0 test/lib/eye/patch/settings_test.rb
eye-patch-0.4.2 test/lib/eye/patch/settings_test.rb
eye-patch-0.4.1 test/lib/eye/patch/settings_test.rb
eye-patch-0.4.0 test/lib/eye/patch/settings_test.rb
eye-patch-0.3.1 test/lib/eye/patch/settings_test.rb