Sha256: 7331f2e72fba75c4ff4eb20710585ec4f8d9e85dff0c3e5faeae2b43580ae4a9

Contents?: true

Size: 576 Bytes

Versions: 14

Compression:

Stored size: 576 Bytes

Contents

require 'spec_helper'
require 'image_optim/space'

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

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
image_optim-0.26.3 spec/image_optim/space_spec.rb
image_optim-0.26.2 spec/image_optim/space_spec.rb
discourse_image_optim-0.26.2 spec/image_optim/space_spec.rb
discourse_image_optim-0.26.1 spec/image_optim/space_spec.rb
image_optim-0.26.1 spec/image_optim/space_spec.rb
image_optim-0.26.0 spec/image_optim/space_spec.rb
image_optim-0.25.0 spec/image_optim/space_spec.rb
discourse_image_optim-0.24.5 spec/image_optim/space_spec.rb
image_optim-0.24.3 spec/image_optim/space_spec.rb
discourse_image_optim-0.24.4 spec/image_optim/space_spec.rb
image_optim-0.24.2 spec/image_optim/space_spec.rb
image_optim-0.24.1 spec/image_optim/space_spec.rb
image_optim-0.24.0 spec/image_optim/space_spec.rb
image_optim-0.23.0 spec/image_optim/space_spec.rb