Sha256: ac8730bc8e34e3edc894722db9770bcad7af056396d4a76cc9329b07f752a015

Contents?: true

Size: 768 Bytes

Versions: 3

Compression:

Stored size: 768 Bytes

Contents

require 'spec_helper'
module Noe
  describe "Template::Entry#rename_one" do
    
    let(:template){ 
      Template.new(Path.relative('../../../../templates/ruby'))
    }
    let(:vars){ 
      {"lower" => "project"} 
    }
    subject{ 
      entry.rename_one(vars) 
    }
    
    describe "when nothing has to change" do
      let(:entry){ template.entry("project") }
      it { should == Path("project") }
    end
    
    describe "when exactly a replacement" do
      let(:entry){ template.entry("__lower__") }
      it { should == Path("project") }
    end
    
    describe "when a replacement inside something else" do
      let(:entry){ template.entry("__lower___spec.rb") }
      it { should == Path("project_spec.rb") }
    end
    
  end
end # module Noe

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
noe-1.7.6 spec/unit/template/entry/rename_one_spec.rb
noe-1.7.5 spec/unit/template/entry/rename_one_spec.rb
noe-1.7.4 spec/unit/template/entry/rename_one_spec.rb