Sha256: 8e34c020fbdfcef3c7da8856a91aa5bd66cb2e92ea5f97def8eee64ff99d3d7d
Contents?: true
Size: 1.18 KB
Versions: 27
Compression:
Stored size: 1.18 KB
Contents
require 'spec_helper' require 'sugar-high/string' describe "SugarHigh" do describe 'String pack' do before do @s = %q{ class Abc def begin end end} @s = %q{ class Abc def begin end blip} end describe '#insert_before_last' do it "should insert '# hello' before last end (default)" do @s.insert_before_last(' # hello').should match /# hello\s*end/ end it "should insert '# hello' before last 'blip' (explicit String marker)" do @s.insert_before_last(' # hello', 'blip').should match /# hello\s*blip/ end it "should insert '# hello' before last 'blip' (explicit Symbol marker)" do @s.insert_before_last(' # hello', :blip).should match /# hello\s*blip/ end it "should insert '# hello' before last 'blip' (explicit Hash-String marker)" do @s.insert_before_last(' # hello', :marker => 'blip').should match /# hello\s*blip/ end it "should insert '# hello' before last 'blip' (explicit Hash-Symbol marker)" do @s.insert_before_last(' # hello', :marker => :blip).should match /# hello\s*blip/ end end end end
Version data entries
27 entries across 27 versions & 1 rubygems