Sha256: 09cbb1af1eb519a65efbfecf1ee6a848f2c14908779a99e5387aa5c19e2407ca

Contents?: true

Size: 505 Bytes

Versions: 6

Compression:

Stored size: 505 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Strings, '#align' do
  it "aligns text" do
    text = "the madness of men"
    expect(Strings.align(text, 22, direction: :center)).to eq("  the madness of men  ")
  end

  it "aligns text to left" do
    text = "the madness of men"
    expect(Strings.align_left(text, 22)).to eq("the madness of men    ")
  end

  it "aligns text to right" do
    text = "the madness of men"
    expect(Strings.align_right(text, 22)).to eq("    the madness of men")
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
strings-0.1.8 spec/unit/align_spec.rb
strings-0.1.7 spec/unit/align_spec.rb
strings-0.1.6 spec/unit/align_spec.rb
strings-0.1.5 spec/unit/align_spec.rb
strings-0.1.4 spec/unit/align_spec.rb
strings-0.1.3 spec/unit/align_spec.rb