Sha256: ffbed2c75029a85692bc360b65697db43b307e26a7b881ef5fdb8f3cb89f9d14

Contents?: true

Size: 897 Bytes

Versions: 11

Compression:

Stored size: 897 Bytes

Contents

# encoding: utf-8

require_relative "../spec_helper"
require "simple-templater/generator"

describe SimpleTemplater::Generator do
  before(:each) do
    @generator_dir = File.join(SPEC_ROOT, "stubs", "test_generator", "stubs", "test")
    @generator = SimpleTemplater::Generator.new(:test, @generator_dir)
  end

  describe "#initialize" do
    it "should take first argument as a name" do
      @generator.name.should eql(:test)
    end

    it "should to_sym" do
      generator = SimpleTemplater::Generator.new("test", @generator_dir)
      generator.name.should eql(:test)
    end

    it "should take second argument as a path" do
      @generator.path.should eql(@generator_dir)
    end

    it "should raise an exception if path doesn't exist" do
      -> { SimpleTemplater::Generator.new(:test, "/i/do/not/exist") }.should raise_error(SimpleTemplater::GeneratorNotFound)
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
simple-templater-0.0.1.6 spec/simple-templater/generator_spec.rb
simple-templater-0.0.1.5 spec/simple-templater/generator_spec.rb
simple-templater-0.0.1.4 spec/simple-templater/generator_spec.rb
simple-templater-0.0.1.3 spec/simple-templater/generator_spec.rb
simple-templater-0.2.pre spec/simple-templater/generator_spec.rb
simple-templater-0.0.1.2 spec/simple-templater/generator_spec.rb
simple-templater-0.0.1.1 spec/simple-templater/generator_spec.rb
rango-0.0.6 vendor/simple-templater/spec/simple-templater/generator_spec.rb
rango-0.1.pre vendor/simple-templater/spec/simple-templater/generator_spec.rb
simple-templater-0.1.pre spec/simple-templater/generator_spec.rb
simple-templater-0.0.1 spec/simple-templater/generator_spec.rb