Sha256: 55a2025083e85094e6efae4b2577909980ec5abbabc68e61a491d8032c125f60

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')

describe 'region matcher' do    
  context "content with only protected region" do
    only_protected_region = %q{
        def hello
        end
        
        protected
        
        def goodbye
        end
        
        }    
    
    it "should not have public region" do            
      only_protected_region.should_not have_region :public do |content|
        puts content
      end
    end

    it "should have protected region" do            
      only_protected_region.should have_region :protected do |content|
        puts content
      end
    end
  end
  
  context "content with only private region" do
    only_private_region = %q{
        def hello
        end
        
        private
        
        def goodbye
        end
        
        }    
    
    it "should not have public region" do            
      only_private_region.should_not have_region :public do |content|
        puts content
      end
    end

    it "should have private region" do            
      only_private_region.should have_region :private do |content|
        puts content
      end
    end
  end
end



Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
generator-spec-0.5.0 spec/generator_spec/matchers/content/have_region_spec.rb
generator-spec-0.4.8 spec/generator_spec/matchers/content/have_region_spec.rb