Class: Shoulda::Matchers::Integrations::TestFrameworks::RspecExpectations
- Inherits:
-
Object
- Object
- Shoulda::Matchers::Integrations::TestFrameworks::RspecExpectations
- Defined in:
- lib/shoulda/matchers/integrations/test_frameworks/cucumber.rb
Instance Method Summary collapse
- #include(*modules, **_options) ⇒ Object
- #n_unit? ⇒ Boolean
- #present? ⇒ Boolean
- #raise_error ⇒ Object
- #validate! ⇒ Object
Instance Method Details
#include(*modules, **_options) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/shoulda/matchers/integrations/test_frameworks/cucumber.rb', line 17 def include(*modules, **) ::RSpec::Matchers.send(:include, *modules) rescue NameError if (require("rspec/expectations")) retry else raise_error end rescue LoadError raise_error end |
#n_unit? ⇒ Boolean
29 30 31 |
# File 'lib/shoulda/matchers/integrations/test_frameworks/cucumber.rb', line 29 def n_unit? false end |
#present? ⇒ Boolean
33 34 35 |
# File 'lib/shoulda/matchers/integrations/test_frameworks/cucumber.rb', line 33 def present? true end |
#raise_error ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/shoulda/matchers/integrations/test_frameworks/cucumber.rb', line 37 def raise_error raise TestFrameworkNotFound, <<-EOT You have to include the 'rspec-expectations' gem to Gemfile, and add the line before requiring the shoulda matchers: require 'rspec/expectations' EOT end |
#validate! ⇒ Object
11 12 13 14 15 |
# File 'lib/shoulda/matchers/integrations/test_frameworks/cucumber.rb', line 11 def validate! return if defined?(::RSpec) && defined?(::RSpec::Matchers) raise_error end |