Sha256: 3aa77f0630714eb6ea8e0605e6b36857de0ff7fec1279a26c796032857944b39

Contents?: true

Size: 591 Bytes

Versions: 1

Compression:

Stored size: 591 Bytes

Contents

-----------------------------------------------
-- mock class: <%= name %> <%= label %>
-----------------------------------------------
-- created at: <%= DateTime.now.strftime("%F %T") %>

local <%= name %> = {}
local <%= name %>MT = {__index = <%= name %>}

function <%= name %>.new(opt)
  local <%= name %>Instance = opt or {}
  <%= name %>Instance.is_mock = true

  assert(type(<%= name %>Instance) == 'table', 'the parameter passed to new() must be a table.')
  setmetatable(<%= name %>Instance, <%= name %>MT)

  return <%= name %>Instance
end

return <%= name %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cbt-0.0.1 templates/Class.mock.lua.erb