Sha256: 5cff69058612029ebe9e02de440045c718ff6768f54136ece3866110845362c4
Contents?: true
Size: 830 Bytes
Versions: 27
Compression:
Stored size: 830 Bytes
Contents
require_relative "helper" scope do module Helper def clean(str) str.strip end end test do Cuba.plugin Helper Cuba.define do on default do res.write clean " foo " end end _, _, body = Cuba.call({}) assert_response body, ["foo"] end end scope do module Number def num 1 end end module Plugin def self.setup(app) app.plugin Number end def bar "baz" end module ClassMethods def foo "bar" end end end setup do Cuba.plugin Plugin Cuba.define do on default do res.write bar res.write num end end end test do assert_equal "bar", Cuba.foo end test do _, _, body = Cuba.call({}) assert_response body, ["baz", "1"] end end
Version data entries
27 entries across 27 versions & 1 rubygems