Adding rspec test for library module doesn't seem to pickup Expectations and Matchers
问题 I'm adding more rspec testing to my app and would like to test a ScoringMethods module, which is in /lib/scoring_methods.rb. So I added a /spec/lib directory and added scoring_methods_spec.rb there. I required spec_helper and set up the describe block as so: require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe ScoringMethods do describe "should have scorePublicContest method" do methods = ScoringMethods.instance_methods methods[0].should match(/scorePublicContest/)