Class: Avm::Git::SpecHelper::StubbedGitRepositoryFile
- Defined in:
- lib/avm/git/spec_helper.rb
Instance Attribute Summary collapse
-
#git ⇒ Object
readonly
Returns the value of attribute git.
-
#subpath ⇒ Object
readonly
Returns the value of attribute subpath.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(git, subpath) ⇒ StubbedGitRepositoryFile
constructor
A new instance of StubbedGitRepositoryFile.
- #path ⇒ Object
- #touch ⇒ Object
- #write(content) ⇒ Object
Constructor Details
#initialize(git, subpath) ⇒ StubbedGitRepositoryFile
Returns a new instance of StubbedGitRepositoryFile.
34 35 36 37 |
# File 'lib/avm/git/spec_helper.rb', line 34 def initialize(git, subpath) @git = git @subpath = subpath end |
Instance Attribute Details
#git ⇒ Object (readonly)
Returns the value of attribute git.
32 33 34 |
# File 'lib/avm/git/spec_helper.rb', line 32 def git @git end |
#subpath ⇒ Object (readonly)
Returns the value of attribute subpath.
32 33 34 |
# File 'lib/avm/git/spec_helper.rb', line 32 def subpath @subpath end |
Instance Method Details
#delete ⇒ Object
47 48 49 |
# File 'lib/avm/git/spec_helper.rb', line 47 def delete ::File.unlink(path) end |
#path ⇒ Object
39 40 41 |
# File 'lib/avm/git/spec_helper.rb', line 39 def path ::File.join(git, *subpath) end |
#touch ⇒ Object
43 44 45 |
# File 'lib/avm/git/spec_helper.rb', line 43 def touch ::FileUtils.touch(path) end |
#write(content) ⇒ Object
51 52 53 |
# File 'lib/avm/git/spec_helper.rb', line 51 def write(content) ::File.write(path, content) end |