Sha256: 0b4e0aaf5ee4987679ca359e5257888b3e70a1bf3a6c04a2ba0042a0647d78d7
Contents?: true
Size: 1.45 KB
Versions: 3
Compression:
Stored size: 1.45 KB
Contents
# frozen_string_literal: true require "spec_helper" describe "JekyllAuth" do before(:each) do setup_tmp_dir JekyllAuth.instance_variable_set("@config", nil) end it "should know the config file path" do expected = File.expand_path "tmp/_config.yml", base_dir expect(JekyllAuth.config_file).to eql(expected) end it "should return a null hash if no config file exists" do expect(JekyllAuth.config).to eql({}) end it "should return a null hash if config file doesn't contain jekyll_auth" do File.write(JekyllAuth.config_file, "foo: bar\n") expect(JekyllAuth.config).to eql({}) end it "should return the config hash if the config files contains jekyll_auth" do File.write(JekyllAuth.config_file, "jekyll_auth:\n ssl: true\n whitelist:\n - drafts?\n") expect(JekyllAuth.config).to eql("ssl" => true, "whitelist" => ["drafts?"]) end it "should disable ssl by default" do expect(JekyllAuth.ssl?).to eql(false) end it "should know when ssl is requested" do File.write(JekyllAuth.config_file, "jekyll_auth:\n ssl:true\n") expect(JekyllAuth.ssl?).to eql(true) end it "should know when ssl is disabled" do File.write(JekyllAuth.config_file, "jekyll_auth:\n ssl:false\n") expect(JekyllAuth.ssl?).to eql(true) end it "should parse the whitelist" do File.write(JekyllAuth.config_file, "jekyll_auth:\n whitelist:\n - drafts?\n") expect(JekyllAuth.whitelist).to eql(%r!drafts?!) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
jekyll-auth-2.1.3 | spec/jekyll_auth_spec.rb |
jekyll-auth-2.1.2 | spec/jekyll_auth_spec.rb |
jekyll-auth-2.1.1 | spec/jekyll_auth_spec.rb |