Sha256: f2edf86890c61e66a2dfee9e4447e5bc0c9ede16db3057de3dcc0d1221083d11

Contents?: true

Size: 1.56 KB

Versions: 1

Compression:

Stored size: 1.56 KB

Contents

require "spec_helper"

describe Cbt::Creator do
  describe "#find_tpl" do
    subject(:crt) { Cbt::Creator.new(config_file: "examples/config/components.yml") }

    it "find tpl for simple module" do
      crt.find_tpl(Cbt::LuaModule.new('utils', 'util')).should eq(File.expand_path("templates/part.lua.erb"))
    end

    it "find tpl for simple Class" do
      crt.find_tpl(Cbt::LuaModule.new('utils', 'Util')).should eq(File.expand_path("templates/Class.lua.erb"))
    end

    it "find tpl for simple module with super class" do
      crt.find_tpl(Cbt::LuaModule.new('utils', 'util<Sp')).should eq(File.expand_path("templates/part_with_super.lua.erb"))
    end

    it "find tpl for simple Class with super class" do
      crt.find_tpl(Cbt::LuaModule.new('utils', 'Util<Sp')).should eq(File.expand_path("templates/Class_with_super.lua.erb"))
    end
    it "find tpl for mock module" do
      crt.find_tpl(Cbt::LuaModule.new('utils', 'util'), true).should eq(File.expand_path("templates/part.mock.lua.erb"))
    end

    it "find tpl for mock Class" do
      crt.find_tpl(Cbt::LuaModule.new('utils', 'Util'), true).should eq(File.expand_path("templates/Class.mock.lua.erb"))
    end

    it "find tpl for mock module" do
      crt.find_tpl(Cbt::LuaModule.new('utils', 'util<Sp'), true).should eq(File.expand_path("templates/part_with_super.mock.lua.erb"))
    end

    it "find tpl for mock Class" do
      crt.find_tpl(Cbt::LuaModule.new('utils', 'Util<Sp'), true).should eq(File.expand_path("templates/Class_with_super.mock.lua.erb"))
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cbt-0.0.1 spec/creator_spec.rb