<commit_before>require 'test_helper'

class Staff < Glimpse::Views::View
  def initialize(options = {})
    @username = options.delete(:username)
  end

  def username
    @username
  end

  def enabled?
    !!@username
  end
end

describe Glimpse do
  describe "enabled?" do
    it "should not be enabled in test" do
      refute Glimpse.enabled?
    end
  end

  describe "env" do
    before do
      ENV['RACK_ENV'] = 'production'
    end

    it "should return the current environment" do
      assert_equal 'production', Glimpse.env
    end
  end

  describe "views" do
    before do
      Glimpse.reset
    end

    it "should have none by default" do
      assert_equal [], Glimpse.views<commit_msg>Guess you can't set env vars in travis ci<commit_after>require 'test_helper'

class Staff < Glimpse::Views::View
  def initialize(options = {})
    @username = options.delete(:username)
  end

  def username
    @username
  end

  def enabled?
    !!@username
  end
end

describe Glimpse do
  describe "enabled?" do
    it "should not be enabled in test" do
      refute Glimpse.enabled?
    end
  end

  describe "env" do
    it "should return the current environment" do
      assert_equal 'test', Glimpse.env
    end
  end

  describe "views" do
    before do
      Glimpse.reset
    end

    it "should have none by default" do
      assert_equal [], Glimpse.views
{'fraction_non_alphanumeric': 0.07860262008733625, 'fraction_numerical': 0.0, 'mean_word_length': 2.7162162162162162, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1316994', 'n_tokens_mistral': 439, 'n_tokens_neox': 437, 'n_words': 148}