Module: RSpec::RailsApp::ArtifactClass::Matchers

Defined in:
lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb,
lib/rails_app_spec/matchers/artifact/class/have_artifact_subclass.rb

Defined Under Namespace

Classes: HaveArtifactClass, HaveArtifactSubclass

Instance Method Summary collapse

Instance Method Details

#have_artifact_class(klass, type = nil) ⇒ Object



17
18
19
# File 'lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb', line 17

def have_artifact_class(klass, type=nil)
  HaveArtifactClass.new klass, type
end

#have_artifact_subclass(klass, superclass, type = nil) ⇒ Object



15
16
17
# File 'lib/rails_app_spec/matchers/artifact/class/have_artifact_subclass.rb', line 15

def have_artifact_subclass klass, superclass, type=nil
  HaveArtifactSubclass.new klass, superclass, type
end

#have_controller_class(klass) ⇒ Object Also known as: be_controller_class



27
28
29
# File 'lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb', line 27

def have_controller_class(klass)
  have_artifact_class klass, :controller
end

#have_helper_class(klass) ⇒ Object Also known as: be_helper_class



21
22
23
# File 'lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb', line 21

def have_helper_class(klass)
  have_artifact_class klass, :helper
end

#have_mailer_class(klass) ⇒ Object

alias_method :be_observer_class, :have_observer_class



24
25
26
# File 'lib/rails_app_spec/matchers/artifact/class/have_artifact_subclass.rb', line 24

def have_mailer_class klass   
  have_artifact_subclass klass, 'ActionMailer::Base', :mailer
end

#have_migration_class(klass) ⇒ Object

alias_method :be_mailer_class, :have_mailer_class



29
30
31
# File 'lib/rails_app_spec/matchers/artifact/class/have_artifact_subclass.rb', line 29

def have_migration_class klass
  have_artifact_subclass klass, 'ActiveRecord::Migration'
end

#have_model_class(klass) ⇒ Object



32
33
34
# File 'lib/rails_app_spec/matchers/artifact/class/have_artifact_class.rb', line 32

def have_model_class(klass)
  have_artifact_class klass
end

#have_observer_class(klass) ⇒ Object



19
20
21
# File 'lib/rails_app_spec/matchers/artifact/class/have_artifact_subclass.rb', line 19

def have_observer_class klass
  have_artifact_subclass klass, 'ActiveRecord::Observer', :observer
end