title: Uninitialized constant NameError in Rspec
body: <p>When I run rails c, I can call the following class and the method works:</p>
  
  <pre><code> test = SlackService::BoardGameNotifier
   test.create_alert("test")
    &gt;&gt;method works 
  </code></pre>
  
  <p>I'm trying to set this up in rspec like this:</p>
  
  <pre><code>require 'spec_helper'
  require 'slack-notifier'
  
  RSpec.describe SlackService::BoardGameNotifier do
   describe '#notify' do
      @notifier = SlackService::BoardGameNotifier
  
      it 'pings Slack' do
        error = nil
        message = "test"
        expect(notifier).to receive(:ping).with(message)
        notifier.send_message()
      end
    end
  end  
  </code></pre>
  
  <p>But I keep getting the error: </p>
  
  <pre><code>  NameError:
    uninitialized constant SlackService
  </code></pre>
  
  <p>Does this have to do with how I set up the module?</p>
  
  <p>My current setup:</p>
  
  <p>slack_service/board_game_notifier.rb</p>
  
  <pre><code>module SlackService
      class BoardGameNotifier &lt; BaseNotifier
        WEBHOOK_URL =   Rails.configuration.x.slack.url
        DEFAULT_OPTIONS = {
          channel: "board-games-channel",
          text: "board games alert",
          username: "bot",
        }
  
        def create_alert(message)
         message #testing
        end
      end
    end
  </code></pre>
  
  <p>slack_service/base_notifier.rb</p>
  
  <pre><code>module SlackService
      class BaseNotifier
        include Singleton
  
        def initialize
          webhook_url = self.class::WEBHOOK_URL
          options = self.class::DEFAULT_OPTIONS
  
          @notifier = Slack::Notifier.new(webhook_url, options)
        end
  
        def self.send_message
          message = instance.create_alert("test")
          instance.notify(message)
        end
  
        def notify(message)
          @notifier.post blocks: message
        end
      end
    end
  </code></pre>