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.4.6 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.5.2 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.5 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.4.2 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.4.1 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.4 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.3 spec/sugar-high/regexp_spec.rb
sugar-high-0.4.0 spec/sugar-high/regexp_spec.rb
sugar-high-0.3.7 spec/sugar-high/regexp_spec.rb
sugar-high-0.3.6 spec/sugar-high/regexp_spec.rb
sugar-high-0.3.5 spec/sugar-high/regexp_spec.rb
sugar-high-0.3.4 spec/sugar-high/regexp_spec.rb
sugar-high-0.3.3 spec/sugar-high/regexp_spec.rb
sugar-high-0.3.2 spec/sugar-high/regexp_spec.rb
sugar-high-0.3.1 spec/sugar-high/regexp_spec.rb
sugar-high-0.3.0 spec/sugar-high/regexp_spec.rb
sugar-high-0.2.12 spec/sugar-high/regexp_spec.rb
sugar-high-0.2.11 spec/sugar-high/regexp_spec.rb
sugar-high-0.2.10 spec/sugar-high/regexp_spec.rb
sugar-high-0.2.9 spec/sugar-high/regexp_spec.rb