Sha256: ce825acd16ad0a80983b9201ff12db1a5cd8e9b6376d1bd9ac09b3b586768304

Contents?: true

Size: 760 Bytes

Versions: 48

Compression:

Stored size: 760 Bytes

Contents

require 'spec_helper'
require 'sugar-high/regexp'

describe "SugarHigh" do
  describe 'Regexp pack' do

    describe 'String#to_regexp' do
      it "should convert string to Regexp" do
        'hello'.to_regexp.should be_a_kind_of Regexp
      end
    end

    describe 'Regexp#to_regexp' do
      it "should return itself as a regexp" do
        /hello/.to_regexp.should be_a_kind_of Regexp
      end
    end

    describe 'Array#grep_it' do
      it "should grep using a regexp" do
        ['hello', 'hello you', 'not you'].grep_it(/hello/).size.should == 2
        ['hello', 'hello you', 'not you'].grep_it('hello').size.should == 2        
        ['hello', 'hello you', 'not you'].grep_it(nil).size.should == 3                
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
sugar-high-0.6.3 spec/sugar-high/regexp_spec.rb
sugar-high-0.6.2.1 spec/sugar-high/regexp_spec.rb
sugar-high-0.6.1 spec/sugar-high/regexp_spec.rb
sugar-high-0.6.0 spec/sugar-high/regexp_spec.rb
sugar-high-0.5.5 spec/sugar-high/regexp_spec.rb
sugar-high-0.5.4 spec/sugar-high/regexp_spec.rb
sugar-high-0.5.3 spec/sugar-high/regexp_spec.rb
sugar-high-0.5.1 spec/sugar-high/regexp_spec.rb
sugar-high-0.5.0 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.9.5 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.9.3 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.9.2 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.9.1 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.9 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.8 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.7 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.6.4 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.6.3 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.6.2 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.6.1 spec/sugar-high/regexp_spec.rb