Class: RSpec::RailsApp::Directory::Matchers::HaveRailsDir
- Inherits:
-
Object
- Object
- RSpec::RailsApp::Directory::Matchers::HaveRailsDir
- Extended by:
- RailsAssist::UseMacro
- Defined in:
- lib/rails_app_spec/matchers/directory/have_rails_dir.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(type = nil) ⇒ HaveRailsDir
constructor
A new instance of HaveRailsDir.
- #matches?(obj, &block) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(type = nil) ⇒ HaveRailsDir
Returns a new instance of HaveRailsDir.
9 10 11 |
# File 'lib/rails_app_spec/matchers/directory/have_rails_dir.rb', line 9 def initialize(type = nil) @type = type end |
Instance Attribute Details
#dir ⇒ Object
Returns the value of attribute dir.
7 8 9 |
# File 'lib/rails_app_spec/matchers/directory/have_rails_dir.rb', line 7 def dir @dir end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/rails_app_spec/matchers/directory/have_rails_dir.rb', line 7 def type @type end |
Instance Method Details
#failure_message ⇒ Object
18 19 20 |
# File 'lib/rails_app_spec/matchers/directory/have_rails_dir.rb', line 18 def "Expected Rails app to have dir: #{relative_path}, but it didn't" end |
#matches?(obj, &block) ⇒ Boolean
13 14 15 16 |
# File 'lib/rails_app_spec/matchers/directory/have_rails_dir.rb', line 13 def matches?(obj, &block) @dir = send :"#{type}_dir" File.directory? dir end |
#negative_failure_message ⇒ Object
22 23 24 |
# File 'lib/rails_app_spec/matchers/directory/have_rails_dir.rb', line 22 def "Did not expected Rails app to have dir: #{relative_path}, but it did" end |