File: logging_spec.rb

package info (click to toggle)
ruby-test-prof 1.6.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,448 kB
  • sloc: ruby: 13,093; sh: 4; makefile: 4
file content (35 lines) | stat: -rw-r--r-- 1,135 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true

describe "Logging" do
  context "RSpec integration" do
    specify "global all", :aggregate_failures do
      output = run_rspec("logging", env: {"LOG" => "all"}, options: "--tag test:global")

      expect(output).to include("examples, 0 failures")

      expect(output).to include("INSERT INTO")
      expect(output).to include("USER: a")
      expect(output).to include("USER: b")
    end

    specify "global active record", :aggregate_failures do
      output = run_rspec("logging", env: {"LOG" => "ar"}, options: "--tag test:global")

      expect(output).to include("examples, 0 failures")

      expect(output).to include("INSERT INTO")
      expect(output).not_to include("USER: a")
      expect(output).not_to include("USER: b")
    end

    specify "tags", :aggregate_failures do
      output = run_rspec("logging", env: {"LOG" => "ar"}, options: "--tag test:tags")

      expect(output).to include("examples, 0 failures")

      expect(output).to include("INSERT INTO")
      expect(output).not_to include("USER: invisible")
      expect(output).to include("USER: visible")
    end
  end
end