Sha256: e07ff303759134b037cfa6a9ef4c792ab6fd98285e8cd8c3116238920af82713

Contents?: true

Size: 552 Bytes

Versions: 12

Compression:

Stored size: 552 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'image_optim/space'

describe ImageOptim::Space do
  describe '.space' do
    {
      '      ' => 0,
      '    1B' => 1,
      '   10B' => 10,
      '  100B' => 100,
      ' 1000B' => 1_000,
      '  9.8K' => 10_000,
      ' 97.7K' => 100_000,
      '976.6K' => 1_000_000,
      '  9.5M' => 10_000_000,
      ' 95.4M' => 100_000_000,
    }.each do |space, size|
      it "converts #{size} to #{space}" do
        expect(described_class.space(size)).to eq(space)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
image_optim-0.31.4 spec/image_optim/space_spec.rb
image_optim-0.31.3 spec/image_optim/space_spec.rb
image_optim-0.31.2 spec/image_optim/space_spec.rb
image_optim-0.31.1 spec/image_optim/space_spec.rb
image_optim-0.31.0 spec/image_optim/space_spec.rb
image_optim-0.30.0 spec/image_optim/space_spec.rb
image_optim-0.29.0 spec/image_optim/space_spec.rb
image_optim-0.28.0 spec/image_optim/space_spec.rb
image_optim-0.27.1 spec/image_optim/space_spec.rb
image_optim-0.27.0 spec/image_optim/space_spec.rb
image_optim-0.26.5 spec/image_optim/space_spec.rb
image_optim-0.26.4 spec/image_optim/space_spec.rb