Sha256: e8244e10c3577e51753e28e8b9c33e0d59ec3374678c3c153bdcf268a5670b5e

Contents?: true

Size: 1.02 KB

Versions: 12

Compression:

Stored size: 1.02 KB

Contents

require "spec_helper"

describe Machined::Utils do
  describe ".avialable_templates" do
    it "returns the available Tilt templates" do
      Machined::Utils.instance_variable_set "@available_templates", nil
      available_templates = Machined::Utils.available_templates
      available_templates[".markdown"].should be(Tilt::RDiscountTemplate)
      available_templates[".md"].should be(Tilt::RDiscountTemplate)
      available_templates[".haml"].should be(Tilt::HamlTemplate)
    end
  end
  
  describe ".existent_directories" do
    it "returns directories that exist in the given path" do
      within_construct do |c|
        c.directory "dir1"
        c.directory "dir2"
        c.directory "dir3"
        
        Machined::Utils.existent_directories(c).should match_paths(%w(dir1 dir2 dir3)).with_root(c)
      end
    end
    
    it "returns an empty array when the path is not a directory" do
      within_construct do |c|
        Machined::Utils.existent_directories(c.join("blank")).should == []
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
machined-0.7.1 spec/machined/utils_spec.rb
machined-0.7.0 spec/machined/utils_spec.rb
machined-0.6.0 spec/machined/utils_spec.rb
machined-0.5.0 spec/machined/utils_spec.rb
machined-0.4.0 spec/machined/utils_spec.rb
machined-0.3.1 spec/machined/utils_spec.rb
machined-0.3.0 spec/machined/utils_spec.rb
machined-0.2.2 spec/machined/utils_spec.rb
machined-0.2.1 spec/machined/utils_spec.rb
machined-0.2.0 spec/machined/utils_spec.rb
machined-0.1.1 spec/machined/utils_spec.rb
machined-0.1.0 spec/machined/utils_spec.rb