Sha256: 4c43eee7ffcecac4febe5e873d9c1ab037cabc1a7700008d38f0f890ed4b7770

Contents?: true

Size: 684 Bytes

Versions: 33

Compression:

Stored size: 684 Bytes

Contents

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

require "knj/strings"
require "knj/errors"

describe "Strings" do
  it "regex" do
    regex = Knj::Strings.regex("/(\d+)/i")
    raise "Regex should be '(?i-mx:(d+))' but wasnt: '#{regex}'." if "#{regex}" != "(?i-mx:(d+))"
    
    regex = Knj::Strings.regex("/\d+/")
    raise "Regex should be '(?-mix:d+)' but wasnt: '#{regex}'." if "#{regex}" != "(?-mix:d+)"
    
    begin
      regex = Knj::Strings.regex("/\d+/U")
      raise "Ruby doesnt support the U-modifier - an exception should be thrown!"
    rescue Knj::Errors::InvalidData
      #this should happen - Ruby doesnt support U-modifier...
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
knjrbfw-0.0.41 spec/strings_spec.rb
knjrbfw-0.0.40 spec/strings_spec.rb
knjrbfw-0.0.39 spec/strings_spec.rb
knjrbfw-0.0.38 spec/strings_spec.rb
knjrbfw-0.0.37 spec/strings_spec.rb
knjrbfw-0.0.36 spec/strings_spec.rb
knjrbfw-0.0.35 spec/strings_spec.rb
knjrbfw-0.0.34 spec/strings_spec.rb
knjrbfw-0.0.33 spec/strings_spec.rb
knjrbfw-0.0.32 spec/strings_spec.rb
knjrbfw-0.0.31 spec/strings_spec.rb
knjrbfw-0.0.30 spec/strings_spec.rb
knjrbfw-0.0.29 spec/strings_spec.rb
knjrbfw-0.0.28 spec/strings_spec.rb
knjrbfw-0.0.27 spec/strings_spec.rb
knjrbfw-0.0.26 spec/strings_spec.rb
knjrbfw-0.0.25 spec/strings_spec.rb
knjrbfw-0.0.24 spec/strings_spec.rb
knjrbfw-0.0.23 spec/strings_spec.rb
knjrbfw-0.0.22 spec/strings_spec.rb