title: Testing Ruby Modules with rspec
body: <p>I'm having a bad time finding on SO/Google this particular case. I have a module with functions and in order to use them, you have to create a Class which includes/extends the Module depending if you'll want instance methods or class methods.</p>
  
  <pre><code>module A
    def say_hello name
      "hello #{name}"
    end
  
    def say_bye
      "bye"
    end
  end
  </code></pre>
  
  <p><strong>How can I test this module using rspec?</strong></p>
  
  <p><strong>I have something like this, and I'm not sure where is the point I should create the class and extend Module.</strong></p>
  
  <pre><code>describe A do
    class MyClass
      extend A
    end
  
    before(:each) { @name = "Radu" }
  
    describe "#say_hello" do
      it "should greet a name" do
        expect(Myclass.say_hello(@name)).to eq "hello Radu"
      end
    end
  end
  </code></pre>
  
  <p>Thank you!</p>