Sha256: 513ab2687491028a7d6736a44d6cb6f4ff1e0c2017fdba9dfd04527486ec4291

Contents?: true

Size: 1.53 KB

Versions: 2

Compression:

Stored size: 1.53 KB

Contents

require 'chars/extensions/string'

require 'spec_helper'

describe String do
  it "should recognize numeric strings" do
    "0987".should be_numeric
  end

  it "should recognize octal strings" do
    "012".should be_octal
  end

  it "should recognize upper-case hexadecimal strings" do
    "2D".should be_uppercase_hex
  end

  it "should recognize lower-case hexadecimal strings" do
    "2d".should be_lowercase_hex
  end

  it "should recognize hexadecimal strings" do
    "2dE3".should be_hex
  end

  it "should recognize upper-case alpha strings" do
    "ABC".should be_uppercase_alpha
  end

  it "should recognize lower-case alpha strings" do
    "abc".should be_lowercase_alpha
  end

  it "should recognize alpha strings" do
    "abcDEF".should be_alpha
  end

  it "should recognize alpha-numeric strings" do
    "abc123".should be_alpha_numeric
  end

  it "should recognize punctuation strings" do
    "[...]".should be_punctuation
  end

  it "should recognize symbolic strings" do
    "++".should be_symbolic
  end

  it "should recognize space strings" do
    "  \t".should be_space
  end

  it "should recognize visible strings" do
    "abc".should be_visible
    "ab c".should_not be_visible
  end

  it "should recognize printable strings" do
    "abc, [123]\nDEF".should be_printable
  end

  it "should recognize control strings" do
    "\b\b\a".should be_control
  end

  it "should recognize signed ASCII strings" do
    "lol\0".should be_signed_ascii
  end

  it "should recognize ASCII strings" do
    "\xff\xfe".should be_ascii
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chars-0.2.0 spec/string_spec.rb
chars-0.1.2 spec/string_spec.rb