Class: StonesSpec::Subject::Callable

Inherits:
Object
  • Object
show all
Defined in:
lib/subject.rb

Direct Known Subclasses

Function, Procedure

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Callable

Returns a new instance of Callable.



34
35
36
# File 'lib/subject.rb', line 34

def initialize(name)
  @name = name
end

Instance Method Details

#call_string(arguments) ⇒ Object



38
39
40
# File 'lib/subject.rb', line 38

def call_string(arguments)
  "#{@name}(#{arguments.join(', ')})"
end

#default_expectationsObject



46
47
48
49
# File 'lib/subject.rb', line 46

def default_expectations
  [ { 'binding' => 'program', 'inspection' => 'Not:HasBinding' },
    { 'binding' => "#{@name}", 'inspection' => 'HasBinding' } ]
end

#default_title(arguments) ⇒ Object



42
43
44
# File 'lib/subject.rb', line 42

def default_title(arguments)
  call_string arguments
end