Sha256: db711b23bf4ed586e3238de3dcf24e95c0e92ba262dea47201b17affa2e021fa

Contents?: true

Size: 872 Bytes

Versions: 9

Compression:

Stored size: 872 Bytes

Contents

require 'spec_helper'

describe 'classes matcher' do    
  context "no class" do
    no_class = %q{
        module X
          hello
          hi
        end
    }    
    
    it "should not have class X" do            
      no_class.should_not have_classes :x
    end
  end

  context "content with class X" do  
    class_x = %q{
      class X
        def hello
          blip
        end
      end
    }    
    it "should have class x" do
      class_x.should have_classes [:x]
      class_x.should_not have_classes :x, :y
    end
  end
  
  context "content with class X and Y" do  
    classs_x_y = %q{
      class X
        def hello
          blip
        end
      end

      class Y
        def hello
          blip
        end
      end
    }    
    it "should have classs x and y" do            
      classs_x_y.should have_classes :x, :y
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
code-spec-0.4.0 spec/code-spec/matchers/multi/have_classes_spec.rb
code-spec-0.3.0 spec/code-spec/matchers/multi/have_classes_spec.rb
code-spec-0.2.11 spec/code-spec/matchers/multi/have_classes_spec.rb
code-spec-0.2.9 spec/code-spec/matchers/multi/have_classes_spec.rb
code-spec-0.2.8 spec/code-spec/matchers/multi/have_classes_spec.rb
code-spec-0.2.7 spec/code-spec/matchers/multi/have_classes_spec.rb
code-spec-0.2.6 spec/code-spec/matchers/multi/have_classes_spec.rb
code-spec-0.2.5 spec/code-spec/matchers/multi/have_classes_spec.rb
code-spec-0.2.4 spec/code-spec/matchers/multi/have_classes_spec.rb