This repository has been archived by the owner on Jul 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a couple of specs for running metrical
- Loading branch information
Showing
7 changed files
with
52 additions
and
6 deletions.
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,8 @@ | |||
#!/usr/bin/env ruby | #!/usr/bin/env ruby | ||
|
|||
# For testing that this file gets loaded | |||
puts "Metrics config loaded" | |||
|
|||
MetricFu::Configuration.run do |config| | MetricFu::Configuration.run do |config| | ||
config.metrics -= [ :rcov ] | config.metrics -= [ :rcov ] | ||
end | end |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,4 @@ | |||
#!/usr/bin/env ruby | #!/usr/bin/env ruby | ||
|
|
||
require "metrical" | require "metrical" | ||
Metrical.run(*ARGV) | Metrical.run(ARGV.dup) |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
require 'optparse' | |||
|
|||
module Metrical | |||
module Options | |||
|
|||
def self.parse(argv) | |||
options = { :open => true } | |||
opts = OptionParser.new do |opts| | |||
|
|||
opts.version = Metrical::VERSION | |||
|
|||
opts.on "--[no-]open", "Automatically open report in browser" do |open| | |||
options[:open] = open | |||
end | |||
|
|||
end | |||
|
|||
opts.parse!(argv) | |||
options | |||
end | |||
|
|||
end | |||
end |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
require 'spec_helper' | |||
|
|||
describe Metrical, "running" do | |||
|
|||
around do |example| | |||
stdin, stdout, stderr = Open3.popen3("metrical --no-open") | |||
@stdout = stdout.read | |||
@stderr = stderr.read | |||
example.run | |||
end | |||
|
|||
it "loads the .metrics file" do | |||
@stdout.should include "Metrics config loaded" | |||
end | |||
|
|||
end |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
require 'bundler/setup' | |||
require 'metrical' |