Module: Waylon::RSpec

Defined in:
lib/waylon/rspec.rb,
lib/waylon/rspec/skill.rb,
lib/waylon/rspec/test_user.rb,
lib/waylon/rspec/test_sense.rb,
lib/waylon/rspec/test_worker.rb,
lib/waylon/rspec/test_channel.rb,
lib/waylon/rspec/test_message.rb,
lib/waylon/rspec/matchers/route_matcher.rb

Overview

RSpec stuff that allows specialized Waylon testing

Defined Under Namespace

Modules: Matchers, Skill Classes: TestChannel, TestMessage, TestSense, TestUser, TestWorker

Class Method Summary collapse

Class Method Details

.included(base) ⇒ void

This method returns an undefined value.

Parameters:

  • base (Object)

    The class including the module.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/waylon/rspec.rb', line 27

def included(base)
  base.class_eval do
    before do
      config = Waylon::Config.instance
      config.load_env
      Waylon::Cache.clear
      Waylon::Storage.clear

      Waylon::RSpec::TestChannel.find_or_create("random")
      Waylon::RSpec::TestUser.find_or_create(
        name: "Waylon Smithers",
        email: "[email protected]"
      )
      Waylon::RSpec::TestUser.find_or_create(name: "Homer Simpson")
    end
  end
end