123456789_123456789_123456789_123456789_123456789_

Module: RSpec::Rails::ChannelExampleGroup::ClassMethods

Overview

Class-level DSL for channel specs.

Instance Method Summary

Instance Method Details

#channel_class

[ GitHub ]

  
# File 'rspec-rails/lib/rspec/rails/example/channel_example_group.rb', line 32

def channel_class
  (_channel_class || described_class).tap { |klass| check_class_type!(klass, "channel", ::ActionCable::Channel::Base) }
end

#check_class_type!(klass, type, ancestor) (private)

[ GitHub ]

  
# File 'rspec-rails/lib/rspec/rails/example/channel_example_group.rb', line 53

def check_class_type!(klass, type, ancestor)
  return true if klass && klass <= ancestor

  raise "Described class is not a #{type} class.\n" \
        "Specify the #{type} class in the `describe` statement " \
        "or set it manually using `tests My#{type.capitialize}Class`"
end

#connection_class

:nocov:

See additional method definition at line 39.

[ GitHub ]

  
# File 'rspec-rails/lib/rspec/rails/example/channel_example_group.rb', line 45

def connection_class
  (super || described_class).tap { |klass| check_class_type!(klass, "connection", ::ActionCable::Connection::Base) }
end