Class: RSpec::RailsApp::Dir::Matchers::HaveRailsDir
- Inherits:
-
Object
- Object
- RSpec::RailsApp::Dir::Matchers::HaveRailsDir
- Includes:
- Rails::Assist::App
- Defined in:
- lib/rails_app_spec/matchers/file/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.
8 9 10 |
# File 'lib/rails_app_spec/matchers/file/have_rails_dir.rb', line 8 def initialize(type = nil) @type = type end |
Instance Attribute Details
#dir ⇒ Object
Returns the value of attribute dir.
6 7 8 |
# File 'lib/rails_app_spec/matchers/file/have_rails_dir.rb', line 6 def dir @dir end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/rails_app_spec/matchers/file/have_rails_dir.rb', line 6 def type @type end |
Instance Method Details
#failure_message ⇒ Object
17 18 19 |
# File 'lib/rails_app_spec/matchers/file/have_rails_dir.rb', line 17 def "Expected Rails app to have dir: #{relative_path}, but it didn't" end |
#matches?(obj, &block) ⇒ Boolean
12 13 14 15 |
# File 'lib/rails_app_spec/matchers/file/have_rails_dir.rb', line 12 def matches?(obj, &block) @dir = send :"#{type}_dir" File.directory? dir end |
#negative_failure_message ⇒ Object
21 22 23 |
# File 'lib/rails_app_spec/matchers/file/have_rails_dir.rb', line 21 def "Did not expected Rails app to have dir: #{relative_path}, but it did" end |