Sha256: 265f2c7e60db64df2099c3bb2311e23da291811b5c91942a04e5cc000284cf2d

Contents?: true

Size: 1.09 KB

Versions: 4

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'
require 'sugar-high/kind_of'

describe "SugarHigh" do
  describe "Kind of helpers" do
    describe '#any_kind_of?' do    
      context 'The number 3' do
        before do
          @obj = 3
        end
        
        it "should not be a kind of String or Symbol" do
          @obj.any_kind_of?(String, Symbol).should be_false
        end
      end

      context 'a String and a Symbol' do
        before do
          @obj_str = "Hello"
          @obj_sym = :hello
        end

        it "should return true for a String" do
          @obj_str.any_kind_of?(String, Symbol).should be_true
        end

        it "should return true for a File" do
          @obj_sym.any_kind_of?(String, Symbol).should be_true
        end
      end
    end

    describe '#kind_of_label?' do    
      before do
        @obj_str = "Hello"
        @obj_sym = :hello
      end

      it "should return true for a String" do
        @obj_str.kind_of_label?.should be_true
      end

      it "should return true for a File" do
        @obj_sym.kind_of_label?.should be_true
      end
    end
  end
end
    

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sugar-high-0.1.4 spec/sugar-high/kind_of_spec.rb
sugar-high-0.1.2 spec/sugar-high/kind_of_spec.rb
sugar-high-0.1.1 spec/sugar-high/kind_of_spec.rb
sugar-high-0.1.0 spec/sugar-high/kind_of_spec.rb