Class: Ruber::RSpec::FilterModel
- Inherits:
-
FilteredOutputWidget::FilterModel
- Object
- Qt::SortFilterProxyModel
- FilteredOutputWidget::FilterModel
- Ruber::RSpec::FilterModel
- Defined in:
- plugins/rspec/rspec.rb,
plugins/rspec/tool_widget.rb
Overview
Filter model used by the RSpec output widget
It allows to choose whether to accept items corresponding to output to standard error or to reject it. To find out if a given item corresponds to the output of standard error or standard output, this model uses the data contained in a custom role in the output. The index of this role is RSpec::OutputWidget::OutputTypeRole.
Instance Attribute Summary (collapse)
-
- (Boolean) display_stderr
Whether output from standard error should be displayed or not.
Attributes inherited from FilteredOutputWidget::FilterModel
Instance Method Summary (collapse)
-
- (Boolean) filterAcceptsRow(r, parent)
Override of FilteredOutputWidget::FilterModel#filterAcceptsRow.
-
- (FilterModel) initialize(parent = nil)
constructor
Create a new instance.
Methods inherited from FilteredOutputWidget::FilterModel
#exclude_from_filtering?, #filter_ignored?, #filter_reg_exp=, #ignore_filter=
Methods inherited from Qt::SortFilterProxyModel
API for feature rspec
Constructor Details
- (FilterModel) initialize(parent = nil)
Create a new instance
The new instance is set not to show the output from standard error
566 567 568 569 |
# File 'plugins/rspec/rspec.rb', line 566 def initialize parent = nil super @display_stderr = false end |
Instance Attribute Details
- (Boolean) display_stderr
Whether output from standard error should be displayed or not
557 558 559 |
# File 'plugins/rspec/rspec.rb', line 557 def display_stderr @display_stderr end |
Instance Method Details
- (Boolean) filterAcceptsRow(r, parent)
Override of FilteredOutputWidget::FilterModel#filterAcceptsRow
According to the value of #display_stderr, it can filter out items corresponding to standard error. In all other respects, it behaves as the base class method.
595 596 597 598 599 600 601 |
# File 'plugins/rspec/rspec.rb', line 595 def filterAcceptsRow r, parent if !@display_stderr idx = source_model.index(r,0,parent) return false if idx.data(OutputWidget::OutputTypeRole).to_string == 'output1' end super end |