Class: RSpec::RailsApp::Directory::Matchers::HaveArtifactDirs
- Inherits:
-
Object
- Object
- RSpec::RailsApp::Directory::Matchers::HaveArtifactDirs
- Extended by:
- RailsAssist::UseMacro
- Defined in:
- lib/rails_app_spec/matchers/directory/have_artifact_dirs.rb
Instance Attribute Summary collapse
-
#artifact_type ⇒ Object
Returns the value of attribute artifact_type.
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#dir_name ⇒ Object
Returns the value of attribute dir_name.
-
#dirs ⇒ Object
Returns the value of attribute dirs.
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(artifact_type, *dirs) ⇒ HaveArtifactDirs
constructor
A new instance of HaveArtifactDirs.
- #matches?(obj, &block) ⇒ Boolean
- #msg ⇒ Object
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(artifact_type, *dirs) ⇒ HaveArtifactDirs
Returns a new instance of HaveArtifactDirs.
9 10 11 12 |
# File 'lib/rails_app_spec/matchers/directory/have_artifact_dirs.rb', line 9 def initialize artifact_type, *dirs @artifact_type = artifact_type @dirs = dirs end |
Instance Attribute Details
#artifact_type ⇒ Object
Returns the value of attribute artifact_type.
7 8 9 |
# File 'lib/rails_app_spec/matchers/directory/have_artifact_dirs.rb', line 7 def artifact_type @artifact_type end |
#dir ⇒ Object
Returns the value of attribute dir.
7 8 9 |
# File 'lib/rails_app_spec/matchers/directory/have_artifact_dirs.rb', line 7 def dir @dir end |
#dir_name ⇒ Object
Returns the value of attribute dir_name.
7 8 9 |
# File 'lib/rails_app_spec/matchers/directory/have_artifact_dirs.rb', line 7 def dir_name @dir_name end |
#dirs ⇒ Object
Returns the value of attribute dirs.
7 8 9 |
# File 'lib/rails_app_spec/matchers/directory/have_artifact_dirs.rb', line 7 def dirs @dirs end |
Instance Method Details
#failure_message ⇒ Object
28 29 30 |
# File 'lib/rails_app_spec/matchers/directory/have_artifact_dirs.rb', line 28 def "Expected #{msg}" end |
#matches?(obj, &block) ⇒ Boolean
14 15 16 17 18 19 20 21 22 |
# File 'lib/rails_app_spec/matchers/directory/have_artifact_dirs.rb', line 14 def matches?(obj, &block) dirs.to_strings.each do |dir_name| @dir_name = dir_name @dir = File.join(send :"#{artifact_type}_dir", dir_name) return false if !File.directory?(dir) end yield if block true end |
#msg ⇒ Object
24 25 26 |
# File 'lib/rails_app_spec/matchers/directory/have_artifact_dirs.rb', line 24 def msg "Rails app to have the #{artifact_type} dir: #{dir_name}" end |
#negative_failure_message ⇒ Object
32 33 34 |
# File 'lib/rails_app_spec/matchers/directory/have_artifact_dirs.rb', line 32 def "Did not expect #{msg}" end |