Sha256: c7a746e62a3a1571a4fe7468f2b14270de1e7fd55cfcbac6eaab98a0b9bc84a7
Contents?: true
Size: 532 Bytes
Versions: 33
Compression:
Stored size: 532 Bytes
Contents
class Gobstones::ExampleCodeBuilder def initialize(code, example, options) @code = code @example = example @options = options end def build return @code unless subject <<GBS #{@code} program { #{code_call} } GBS end private def code_call subject.initial_is_lower? ? "return (#{invocation})" : invocation end def subject @options[:subject] end def invocation "#{subject}(#{arguments})" end def arguments (@example[:preconditions][:arguments] || []).join ',' end end
Version data entries
33 entries across 33 versions & 1 rubygems