forked from jscruggs/metric_fu
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tests failing when config.order set to random #115
Merged
robincurry
merged 6 commits into
metricfu:master
from
robincurry:bug/random-test-order-fixes
Aug 10, 2013
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d0e4483
Move run spec fakefs cleanup to correct spot.
0302b09
Reset MetricFu after each spec.
abbe9e7
Update stubbed methods related to open in browser
0c8d535
Add file system stubs for rbx.
00713d2
Use configure_metrics shortcut.
3e5881c
Fix for undefined json issues in specs.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,12 @@ | |
# for some platforms. | ||
@metric_with_graph = MetricFu.configuration.mri? ? :cane : :flay | ||
@metric_without_graph = :hotspots | ||
MetricFu::Configuration.run do |config| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason you prefer MetricFu::Configuration.run {} over MetricFu.configuration.configure_metrics {}? |
||
config.configure_metrics.each do |metric| | ||
metric.enabled = true if [@metric_with_graph, @metric_without_graph].include?(metric.name) | ||
end | ||
end | ||
|
||
MetricFu.result.add(@metric_with_graph) # metric w/ graph | ||
MetricFu.result.add(@metric_without_graph) # metric w/out graph | ||
end | ||
|
@@ -67,7 +73,8 @@ def directory(name) | |
|
||
context 'when on OS X' do | ||
before do | ||
MetricFu.configuration.stub(:platform).and_return('darwin') | ||
MetricFu.configuration.stub(:osx?).and_return(true) | ||
MetricFu.configuration.stub(:is_cruise_control_rb?).and_return(false) | ||
end | ||
|
||
it "can open the results in the browser" do | ||
|
@@ -117,7 +124,8 @@ def directory(name) | |
|
||
context 'when on OS X' do | ||
before do | ||
MetricFu.configuration.stub(:platform).and_return('darwin') | ||
MetricFu.configuration.stub(:osx?).and_return(true) | ||
MetricFu.configuration.stub(:is_cruise_control_rb?).and_return(false) | ||
end | ||
|
||
it "can open the results in the browser from the custom output directory" do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a testing concern, only, I'd rather monkey-patch the module in spec/support/metric_monkey.rb or something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, went back and forth on that myself.