Class: Pretentious::RspecGenerator

Inherits:
GeneratorBase show all
Defined in:
lib/pretentious/rspec_generator.rb

Overview

Generator for RSPEC

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from GeneratorBase

#body, #buffer, #buffer_inline, #buffer_inline_to_string, #buffer_to_string, #initialize, #setup_fixture

Constructor Details

This class inherits a constructor from Pretentious::GeneratorBase

Class Method Details

.to_symObject



4
5
6
# File 'lib/pretentious/rspec_generator.rb', line 4

def self.to_sym
  :spec
end

Instance Method Details

#begin_spec(test_class) ⇒ Object



8
9
10
11
12
13
# File 'lib/pretentious/rspec_generator.rb', line 8

def begin_spec(test_class)
  buffer('# This file was automatically generated by the pretentious gem')
  buffer("require 'spec_helper'")
  whitespace
  buffer("RSpec.describe #{test_class.name} do")
end

#end_specObject



15
16
17
# File 'lib/pretentious/rspec_generator.rb', line 15

def end_spec
  buffer('end')
end

#outputObject



19
20
21
# File 'lib/pretentious/rspec_generator.rb', line 19

def output
  @output_buffer
end