Sha256: 62c90a45ea746c2e33e90b645bd9aa839cf4f0ab317a854978de22d2a515ef78
Contents?: true
Size: 836 Bytes
Versions: 76
Compression:
Stored size: 836 Bytes
Contents
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper") describe String do before do @string = %{ 0123456789 012345 01234567 0123 }.tabto(0).strip end it "can translate indices to column numbers" do @string.column_of(0).should == 1 @string.column_of(5).should == 6 @string.column_of(10).should == 11 @string.column_of(11).should == 1 @string.column_of(17).should == 7 @string.column_of(18).should == 1 @string.column_of(24).should == 7 end it "can translate indices to line numbers" do @string.line_of(0).should == 1 @string.line_of(5).should == 1 @string.line_of(10).should == 1 @string.line_of(11).should == 2 @string.line_of(17).should == 2 @string.line_of(18).should == 3 @string.line_of(24).should == 3 end end
Version data entries
76 entries across 76 versions & 7 rubygems