<commit_before>require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")

describe "Bluff graphers responding to #graph!" do
  it "should write chart file" do
    MetricFu.configuration
    graphs = {}
    MetricFu::AVAILABLE_GRAPHS.each do |graph|
      graphs[graph] = MetricFu.const_get("#{graph.to_s.capitalize}BluffGrapher").new
    end
    graphs.each do |key, val|
      val.graph!
      lambda{ File.open(File.join(MetricFu.output_directory, "#{key.to_s.downcase}.js")) }.should_not raise_error
    end
  end
end<commit_msg>fixing a spec that was failing because the path wasn't expanded<commit_after>require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")

describe "Bluff graphers responding to #graph!" do
  it "should write chart file" do
    MetricFu.configuration
    graphs = {}
    MetricFu::AVAILABLE_GRAPHS.each do |graph|
      graphs[graph] = MetricFu.const_get("#{graph.to_s.capitalize}BluffGrapher").new
    end
    graphs.each do |key, val|
      val.graph!
      output_dir = File.expand_path(File.join(MetricFu.output_directory))
      lambda{ File.open(File.join(output_dir, "#{key.to_s.downcase}.js")) }.should_not raise_error
    end
  end
end
{'fraction_non_alphanumeric': 0.12822647793505412, 'fraction_numerical': 0.0, 'mean_word_length': 3.9262295081967213, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5088155', 'n_tokens_mistral': 412, 'n_tokens_neox': 394, 'n_words': 85}