Sha256: ada766fb7f839351535d31a17df5429fddb82a6c87ebb97a2f3abd530181a9e1

Contents?: true

Size: 1.07 KB

Versions: 19

Compression:

Stored size: 1.07 KB

Contents

module RSpec::RailsApp::ArtifactClass
  module Matchers    
    class HaveArtifactClass < RSpec::RubyContentMatchers::HaveClass
      def failure_message
        super                     
        puts "Content: #{content}"        
        "Expected the code to have a #{postfix} class called #{name}#{postfix}"
      end 

      def negative_failure_message
        super                                      
        puts "Content: #{content}"        
        "Did not expected there to be the #{postfix} class #{name}#{postfix}"
      end      
    end

    def have_artifact_class(klass, type=nil)
      HaveArtifactClass.new klass, type
    end
    
    def have_helper_class(klass)
      have_artifact_class klass, :helper
    end    
    alias_method :be_helper_class, :have_helper_class


    def have_controller_class(klass)
      have_artifact_class klass, :controller
    end
    alias_method :be_controller_class, :have_controller_class  

    def have_model_class(klass)
      have_artifact_class klass
    end
    alias_method :be_controller_class, :have_controller_class  

  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
rails-app-spec-0.5.0 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.4.0 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.3.3 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.3.2 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.3.1 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.3.0 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.2.16 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.2.15 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.2.14 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.2.13 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.2.12 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.2.10 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.2.8 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.2.7 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.2.5 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.2.4 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.2.3 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.2.0 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb
rails-app-spec-0.1.0 lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb