Sha256: bec357b9d7c78d92390971eb4c2b69ad600f00111cfcbc39aec2595dc1b41974

Contents?: true

Size: 1.94 KB

Versions: 17

Compression:

Stored size: 1.94 KB

Contents

require "spec_helper"

describe GhostInThePost do

  before :each do
    #reload so that variables are set to initials values
    quiet_load 'ghost_in_the_post.rb'
  end
  
  describe "#create=" do
    it "should complain if you add unknown keys" do
      expect do
        GhostInThePost.config = {bad_key: "blah"} 
      end.to raise_error(ArgumentError)
    end
    it "should set phantomjs_path" do
      GhostInThePost.config = {phantomjs_path: "test_path"}
      expect(GhostInThePost.phantomjs_path).to eq("test_path")
    end
    it "should raise ArgumentError if not path was set for phantom" do
      expect do
        GhostInThePost.config = {} 
      end.to raise_error(ArgumentError)
    end
    it "should set includes" do
      GhostInThePost.config = {phantomjs_path: "test_path", includes: ["test"]}
      expect(GhostInThePost.includes).to eq(["test"])
    end
    it "should force includes to an array" do
      GhostInThePost.config = {phantomjs_path: "test_path", includes: "test"}
      expect(GhostInThePost.includes).to eq(["test"])
    end
    it "should default includes to an empty array" do
      GhostInThePost.config = {phantomjs_path: "test_path"}
      expect(GhostInThePost.includes).to eq([])
    end
    it "should set remove_js_tags" do
      GhostInThePost.config = {phantomjs_path: "test_path", remove_js_tags: false}
      expect(GhostInThePost.remove_js_tags).to eq(false)
    end
    it "should default remove_js_tags to true" do
      GhostInThePost.config = {phantomjs_path: "test_path"}
      expect(GhostInThePost.remove_js_tags).to eq(true)
    end
  end

  describe "#phantomjs_path" do
    it "should return phantomjs_path" do
      GhostInThePost.config = {phantomjs_path: "test_path"}
      expect(GhostInThePost.phantomjs_path).to eq("test_path")
    end
    it "should raise and ArgumentError if the path is not set" do
      expect do
        GhostInThePost.phantomjs_path
      end.to raise_error(ArgumentError)
    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ghost_in_the_post-0.1.3 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.1.2 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.1.0 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.0.14 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.0.13 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.0.12 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.0.11 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.0.10 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.0.9 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.0.8 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.0.7 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.0.6 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.0.5 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.0.4 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.0.3 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.0.2 spec/lib/ghost_in_the_post_spec.rb
ghost_in_the_post-0.0.1 spec/lib/ghost_in_the_post_spec.rb