Sha256: e8d27effaec1496fe62951745331c0fa82705557c5186a6171c2ea9c72e15d9e

Contents?: true

Size: 736 Bytes

Versions: 4

Compression:

Stored size: 736 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

4 entries across 4 versions & 1 rubygems

Version Path
sugar-high-0.7.3 spec/sugar-high/regexp_spec.rb
sugar-high-0.7.2 spec/sugar-high/regexp_spec.rb
sugar-high-0.7.1 spec/sugar-high/regexp_spec.rb
sugar-high-0.7.0 spec/sugar-high/regexp_spec.rb