Sha256: 8404f83ad5ccbd2394deaf3d70d13240c8d91503ff87c8432cd160bb5ea6a42c

Contents?: true

Size: 997 Bytes

Versions: 1

Compression:

Stored size: 997 Bytes

Contents

# frozen_string_literal: true

# File: placeholder_spec.rb
require_relative '../../spec_helper'

# Load the classes under test
require_relative '../../../lib/macros4cuke/templating/static-text'

module Macros4Cuke
module Templating # Open this namespace to get rid of module qualifier prefixes
describe StaticText do
  let(:sample_text) { 'Some text' }
  
  subject { StaticText.new(sample_text) }

  context 'Creation and initialization:' do
    it 'should be created with a text' do
      expect { StaticText.new(sample_text) }.not_to raise_error
    end
    
    it 'should know its source text' do
      expect(subject.source).to eq(sample_text)
    end
    
  end # context
  
  context 'Provided services:' do
    it 'should render the source text as is' do
      context = double('fake_context')
      locals = double('fake_locals')
      
      expect(subject.render(context, locals)).to eq(sample_text)
    end
  
  end # context  
end # describe
end # module
end # module

# End of file

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
macros4cuke-0.5.17 spec/macros4cuke/templating/static_text_spec.rb