Sha256: 6dff83804b26827ee7b44aae72ae812edf83f7599ced23be2b8567c39e058ed4

Contents?: true

Size: 715 Bytes

Versions: 36

Compression:

Stored size: 715 Bytes

Contents

require 'lib/ramaze/spec/helper/snippets'

describe "String#unindent" do
  it "should remove indentation" do
    %(
      hello
        how
          are
        you
      doing
    ).ui.should == \
%(hello
  how
    are
  you
doing)
  end

  it 'should not break on a single line' do
    'word'.unindent.should == 'word'
  end

  it 'should find the first line with indentation' do
%(  hi
  there
    bob).ui.should == \
%(hi
there
  bob)
  end

  it 'should have destructive version' do
    str = %(  1\n    2\n  3)
    str.ui!
    str.should == %(1\n  2\n3)
  end

  it 'should use indentation from the last line if first line is not indented' do
    %(a{
      abc
    }).ui.should == %(a{\n  abc\n})
  end
end

Version data entries

36 entries across 36 versions & 6 rubygems

Version Path
Pistos-ramaze-2008.09 spec/snippets/string/unindent.rb
Pistos-ramaze-2008.12 spec/snippets/string/unindent.rb
Pistos-ramaze-2009.01 spec/snippets/string/unindent.rb
Pistos-ramaze-2009.02 spec/snippets/string/unindent.rb
Pistos-ramaze-2009.04.08 spec/snippets/string/unindent.rb
clivecrous-ramaze-0.3.9.5 spec/snippets/string/unindent.rb
manveru-ramaze-2008.07 spec/snippets/string/unindent.rb
manveru-ramaze-2008.08 spec/snippets/string/unindent.rb
manveru-ramaze-2008.09 spec/snippets/string/unindent.rb
manveru-ramaze-2008.10 spec/snippets/string/unindent.rb
manveru-ramaze-2008.12 spec/snippets/string/unindent.rb
manveru-ramaze-2009.01 spec/snippets/string/unindent.rb
manveru-ramaze-2009.04.01 spec/snippets/string/unindent.rb
manveru-ramaze-2009.04.08 spec/snippets/string/unindent.rb
manveru-ramaze-2009.04.18 spec/snippets/string/unindent.rb
manveru-ramaze-2009.04.22 spec/snippets/string/unindent.rb
manveru-ramaze-2009.04 spec/snippets/string/unindent.rb
manveru-ramaze-2009.05.08 spec/snippets/string/unindent.rb
manveru-ramaze-2009.05 spec/snippets/string/unindent.rb
manveru-ramaze-2009.06.04 spec/snippets/string/unindent.rb