Sha256: e062a1a9fd1037a3fffdfe35ee740e6fb3eac950023c62bcb509c213b17b54c4

Contents?: true

Size: 695 Bytes

Versions: 16

Compression:

Stored size: 695 Bytes

Contents

require 'spec_helper'

describe 'subclass matcher' do    
  context "content without subclass Greeting" do
    no_subclass = %q{
        class Hello
          def hello
          end
        end}    
    
    it "should not have subclass Greeting" do            
      no_subclass.should_not have_subclass :hello, :greeting
    end
  end
  
  context "content with subclass Greeting" do
    with_subclass = %q{
        class Hello < Greeting
          def hello
          end
        end}    
    
    it "should not have subclass Greeting" do            
      with_subclass.should have_subclass :hello, :greeting do |content|
        content.should_not be_empty
      end
    end
  end
end



Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
code-spec-0.4.0 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.3.0 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.2.11 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.2.9 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.2.8 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.2.7 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.2.6 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.2.5 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.2.4 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.2.3 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.2.2 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.2.1 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.2.0 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.1.3 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.1.2 spec/code-spec/matchers/have_subclass_spec.rb
code-spec-0.1.0 spec/code-spec/matchers/have_subclass_spec.rb