ruby - How do you include a mixin when using Minitest specs? -


how should include mixin when using minitest specs?

this example of test suite in minitest specs:

require "minitest/autorun"  describe meme   before     @meme = meme.new   end    describe "when asked cheeseburgers"     "must respond positively"       @meme.i_can_has_cheezburger?.must_equal "ohai!"    end   end end 

the top-level describe block defines test case in same way class definition if writing assert-style tests, you'll include mixin module would:

require "minitest/autorun"  describe meme   include mymixin    before     @meme = meme.new   end    describe "when asked cheeseburgers"     "must respond positively"       @meme.i_can_has_cheezburger?.must_equal "ohai!"    end   end end 

remember: minitest ruby.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -