diff --git a/NEWS.md b/NEWS.md index 3a37d605..289288ba 100644 --- a/NEWS.md +++ b/NEWS.md @@ -19,7 +19,7 @@ include the gem as normal. * You'll need to add the following somewhere in your `rails_helper` (for RSpec) or `test_helper` (for Minitest / Test::Unit): - + ``` ruby Shoulda::Matchers.configure do |config| config.integrate do |with| @@ -29,11 +29,11 @@ with.test_framework :minitest_4 with.test_framework :test_unit - # Choose a library: + # Choose one or more libraries: with.library :active_record with.library :active_model with.library :action_controller - # Or, choose all of the above: + # Or, choose the following (which implies all of the above): with.library :rails end end diff --git a/README.md b/README.md index ba65c148..6af05905 100644 --- a/README.md +++ b/README.md @@ -165,11 +165,11 @@ Shoulda::Matchers.configure do |config| with.test_framework :minitest_4 with.test_framework :test_unit - # Choose a library: + # Choose one or more libraries: with.library :active_record with.library :active_model with.library :action_controller - # Or, choose all of the above: + # Or, choose the following (which implies all of the above): with.library :rails end end diff --git a/lib/shoulda/matchers/integrations/configuration.rb b/lib/shoulda/matchers/integrations/configuration.rb index dd504f8f..b7179bf3 100644 --- a/lib/shoulda/matchers/integrations/configuration.rb +++ b/lib/shoulda/matchers/integrations/configuration.rb @@ -11,6 +11,7 @@ module Shoulda def initialize(configuration, &block) @test_frameworks = Set.new + @libraries = Set.new test_framework :missing_test_framework library :missing_library @@ -24,14 +25,14 @@ module Shoulda end def library(name) - @library = Integrations.find_library!(name) + @libraries << Integrations.find_library!(name) end def apply - if no_test_frameworks_added? && library_not_set? + if no_test_frameworks_added? && no_libraries_added? raise ConfigurationError, <