Class: RubySpecWriter

Inherits:
RubyScriptWriter show all
Defined in:
lib/rubyspecwriter.rb

Instance Attribute Summary

Attributes inherited from RubyScriptWriter

#r

Instance Method Summary collapse

Methods inherited from RubyScriptWriter

#comment, #indent, #initialize, #outdent, #put_class, #put_coding, #put_method, #put_simple_method, #puts, #tabs, #to_s

Constructor Details

This class inherits a constructor from RubyScriptWriter

Instance Method Details

#put_description(thing_being_described) {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



4
5
6
7
8
9
10
11
# File 'lib/rubyspecwriter.rb', line 4

def put_description(thing_being_described)
  puts "describe ", thing_being_described, " do"
  indent
  yield self
  outdent
  puts "end"
  puts
end

#put_spec(specficiation_in_words) {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



13
14
15
16
17
18
19
20
# File 'lib/rubyspecwriter.rb', line 13

def put_spec(specficiation_in_words)
  puts "it '",specficiation_in_words.tr("'",""), "' do"
  indent
  yield self
  outdent
  puts "end"
  puts
end