Sha256: 63a01e3843dcaf7a1917c6aae25273f4352fe2e0ee98a38f03876d20f66654c6

Contents?: true

Size: 665 Bytes

Versions: 5

Compression:

Stored size: 665 Bytes

Contents

# frozen_string_literal: true

require_relative "../lib/flexible_include"

RSpec.describe(FlexibleInclude) do
  it "controls access to files" do
    ENV['FLEXIBLE_INCLUDE_PATHS'] = '~/.*:spec/.*'

    FlexibleInclude.send(:new, 'my_tag', "", Liquid::ParseContext.new)
    FlexibleInclude.security_check
    expect(FlexibleInclude.access_allowed(__FILE__)).to be_truthy

    expect(FlexibleInclude.access_allowed("~/.mem_settings.yaml")).to be_truthy

    home_file = JekyllTagHelper.expand_env("$HOME/.mem_settings.yaml")
    expect(FlexibleInclude.access_allowed(home_file)).to be_truthy

    expect(FlexibleInclude.access_allowed('/asdf')).to be_falsey
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
jekyll_flexible_include-2.0.14 spec/glob_spec.rb
jekyll_flexible_include-2.0.13 spec/glob_spec.rb
jekyll_flexible_include-2.0.11 spec/glob_spec.rb
jekyll_flexible_include-2.0.10 spec/glob_spec.rb
jekyll_flexible_include-2.0.9 spec/glob_spec.rb