Sha256: 2419a8820e4742a2d344cfdb694e80b0272966740376da469cf097a9553ffe07

Contents?: true

Size: 422 Bytes

Versions: 22

Compression:

Stored size: 422 Bytes

Contents

require_relative "test_helper"

class ExplainTest < Minitest::Test
  def setup
    City.delete_all
  end

  def test_explain
    City.create!
    PgHero.explain("ANALYZE DELETE FROM cities")
    assert_equal 1, City.count
  end

  def test_explain_multiple_statements
    City.create!
    assert_raises(ActiveRecord::StatementInvalid) { PgHero.explain("ANALYZE DELETE FROM cities; DELETE FROM cities; COMMIT") }
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
pghero-1.7.0 test/explain_test.rb
pghero-1.6.5 test/explain_test.rb
pghero-1.6.4 test/explain_test.rb
pghero-1.6.3 test/explain_test.rb
pghero-1.6.2 test/explain_test.rb
pghero-1.6.1 test/explain_test.rb
pghero-1.6.0 test/explain_test.rb
pghero-1.5.3 test/explain_test.rb
pghero-1.5.2 test/explain_test.rb
pghero-1.5.1 test/explain_test.rb
pghero-1.5.0 test/explain_test.rb
pghero-1.4.2 test/explain_test.rb
pghero-1.4.1 test/explain_test.rb
pghero-1.4.0 test/explain_test.rb
pghero-1.3.2 test/explain_test.rb
pghero-1.3.1 test/explain_test.rb
pghero-1.3.0 test/explain_test.rb
pghero-1.2.4 test/explain_test.rb
pghero-1.2.3 test/explain_test.rb
pghero-1.2.2 test/explain_test.rb