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

Version Path
sugar-high-0.5.1 spec/sugar-high/string_spec.rb
sugar-high-0.5.0 spec/sugar-high/string_spec.rb
sugar-high-0.4.9.5 spec/sugar-high/string_spec.rb
sugar-high-0.4.9.3 spec/sugar-high/string_spec.rb
sugar-high-0.4.9.2 spec/sugar-high/string_spec.rb
sugar-high-0.4.9.1 spec/sugar-high/string_spec.rb
sugar-high-0.4.9 spec/sugar-high/string_spec.rb
sugar-high-0.4.8 spec/sugar-high/string_spec.rb
sugar-high-0.4.7 spec/sugar-high/string_spec.rb
sugar-high-0.4.6.4 spec/sugar-high/string_spec.rb
sugar-high-0.4.6.3 spec/sugar-high/string_spec.rb
sugar-high-0.4.6.2 spec/sugar-high/string_spec.rb
sugar-high-0.4.6.1 spec/sugar-high/string_spec.rb
sugar-high-0.4.6 spec/sugar-high/string_spec.rb
sugar-high-0.4.5.2 spec/sugar-high/string_spec.rb
sugar-high-0.4.5 spec/sugar-high/string_spec.rb
sugar-high-0.4.4.2 spec/sugar-high/string_spec.rb
sugar-high-0.4.4.1 spec/sugar-high/string_spec.rb
sugar-high-0.4.4 spec/sugar-high/string_spec.rb
sugar-high-0.4.3 spec/sugar-high/string_spec.rb