<commit_before>require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb')
require "pp"

describe "GET /stylesheets/filepath.css" do

  before(:all) do
    mount_slice
    @store = MerbDynamicSass.action_cache_store
    @file =  MerbDynamicSass.dir_for(:view) / :stylesheets / "basic.css.erb"

    # Create a template file
    @store.send :write_file, @file, <<-CONTENT
h1
  color: red
    CONTENT
  end

  after(:all) do
    FileUtils.rm @file
    MerbDynamicSass.action_cache_store.delete("basic.css")
  end

  unless Merb::Slices.config[:merb_dynamic_sass][:page_cache]

  it "should be successful and return a appropriate content-type header." do
    response = request("/stylesheets/basic.css")<commit_msg>add code to create direcotires which is necessary to execute spec.<commit_after>require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb')
require "pp"

describe "GET /stylesheets/filepath.css" do

  before(:all) do
    mount_slice
    @store = MerbDynamicSass.action_cache_store
    @file =  MerbDynamicSass.dir_for(:view) / :stylesheets / "basic.css.erb"
    
    # This direcotry is necessary for this test.
    template_dir = MerbDynamicSass.dir_for(:view) / :stylesheets
    unless File.directory? template_dir
      FileUtils.mkdir_p template_dir
    end

    # Create a template file
    @store.send :write_file, @file, <<-CONTENT
h1
  color: red
    CONTENT
  end

  after(:all) do
    FileUtils.rm @file
    MerbDynamicSass.action_cache_store.delete("basic.css")
  end

  unless Merb::Slices.config[:merb_dynamic_sass][:page_cache]

  it "should be successful and return a appropriate content-type header." do
    response = request("/stylesheets/basic.css")
{'fraction_non_alphanumeric': 0.11176818450620934, 'fraction_numerical': 0.0011827321111768185, 'mean_word_length': 3.9043478260869566, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7537249', 'n_tokens_mistral': 582, 'n_tokens_neox': 557, 'n_words': 129}