Class: MakerWebsite::RunRSpec
- Inherits:
-
Object
- Object
- MakerWebsite::RunRSpec
- Defined in:
- lib/maker_website/run_rspec.rb
Instance Attribute Summary collapse
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file_name) ⇒ RunRSpec
constructor
A new instance of RunRSpec.
- #run ⇒ Object
- #spec_file ⇒ Object
Constructor Details
#initialize(file_name) ⇒ RunRSpec
Returns a new instance of RunRSpec.
16 17 18 |
# File 'lib/maker_website/run_rspec.rb', line 16 def initialize(file_name) @file_name = file_name end |
Instance Attribute Details
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
10 11 12 |
# File 'lib/maker_website/run_rspec.rb', line 10 def file_name @file_name end |
Class Method Details
.with(file_name:) ⇒ Object
12 13 14 |
# File 'lib/maker_website/run_rspec.rb', line 12 def self.with(file_name:) self.new(file_name).run end |
Instance Method Details
#run ⇒ Object
20 21 22 23 24 25 |
# File 'lib/maker_website/run_rspec.rb', line 20 def run reporter.register_listener(formatter, *notifications) RSpec::Core::Runner.run([spec_file]) formatter.output_hash end |
#spec_file ⇒ Object
27 28 29 |
# File 'lib/maker_website/run_rspec.rb', line 27 def spec_file @spec_file ||= File.( "stages/#{file_name}", File.dirname(__FILE__)) end |