Sha256: d2815cc9bda895d8d42ae8d5f7504e26af9c2430eefc3d0c9333d305c06adec0

Contents?: true

Size: 664 Bytes

Versions: 1

Compression:

Stored size: 664 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "GlitchedString" do
  before(:each) do
    @str = 'foo'
    @str_size = @str.size
  end
  it "generates glitched string" do
    @str.glitch.size.should == @str_size * (8 + 8 + 8 + 1)
    @str.should == 'foo'
  end

  it "generates glitched string with options" do
    @str.glitch(:upper => 2, :middle => 4, :lower => 10).size.should == @str_size * (2 + 4 + 10 + 1)
    @str.should == 'foo'
  end

  it "generate glitched string destructively" do
    result = @str.glitch!
    result.size.should == @str_size * (8 + 8 + 8 + 1)
    @str.size.should == @str_size * (8 + 8 + 8 + 1)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
glitched_string-0.1.0 spec/glitched_string_spec.rb