Skip to content

Commit

Permalink
single method to print report given date range and input/output locat…
Browse files Browse the repository at this point in the history
…ions, modify test to use it
  • Loading branch information
jmartin-sul committed Apr 5, 2016
1 parent e244acd commit f88c819
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 6 additions & 0 deletions lib/rwj_reporter.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
class RwjReporter
def self.print_reports_for_dates(start_date_str, end_date_str, log_file_dir=nil, output_dir=nil)
rr = RwjReporter.new(log_file_dir)
rr.channel_counts(start_date_str, end_date_str)
rr.print_channel_counts_files(output_dir)
end

def initialize(log_file_dir=nil)
@log_file_dir = if log_file_dir
log_file_dir
Expand Down
4 changes: 1 addition & 3 deletions spec/lib/rwj_reporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@

context '#print_channel_counts_files' do
before(:context) {
rr = RwjReporter.new 'spec/fixtures/'
rr.channel_counts('160228', '160303')
rr.print_channel_counts_files '.'
RwjReporter.print_reports_for_dates('160228', '160303', 'spec/fixtures/', '.')
}
let (:channel1_data_array) { File.open('160228-160303_channel_1_usage_counts.csv').readlines }
let (:channel2_data_array) { File.open('160228-160303_channel_2_usage_counts.csv').readlines }
Expand Down

0 comments on commit f88c819

Please sign in to comment.