Class: EasyRspec::RspecFile
- Inherits:
-
Object
- Object
- EasyRspec::RspecFile
- Defined in:
- lib/easy_rspec/rspec_file.rb
Instance Method Summary collapse
- #directory ⇒ Object
-
#initialize(original_file) ⇒ RspecFile
constructor
A new instance of RspecFile.
- #name ⇒ Object
- #path ⇒ Object
Constructor Details
#initialize(original_file) ⇒ RspecFile
Returns a new instance of RspecFile.
4 5 6 |
# File 'lib/easy_rspec/rspec_file.rb', line 4 def initialize(original_file) @original_file = original_file end |
Instance Method Details
#directory ⇒ Object
12 13 14 |
# File 'lib/easy_rspec/rspec_file.rb', line 12 def directory @original_file.directory.sub('app/', 'spec/') end |
#name ⇒ Object
16 17 18 |
# File 'lib/easy_rspec/rspec_file.rb', line 16 def name @original_file.name.sub('.rb', '_spec.rb') end |
#path ⇒ Object
8 9 10 |
# File 'lib/easy_rspec/rspec_file.rb', line 8 def path "#{directory}#{name}" end |