Class: ActiveSupport::TestCase

Inherits:
Object
  • Object
show all
Defined in:
lib/active_support/test_case.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.skip_database(&block) ⇒ Object

the block will be called only if database execution is skipped



6
7
8
# File 'lib/active_support/test_case.rb', line 6

def skip_database(&block)
  block.bind(self).call if SkipDatabase::Runner.skipping_database
end

.skipping_database?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/active_support/test_case.rb', line 15

def skipping_database?
  SkipDatabase::Runner.skipping_database
end

.with_database(&block) ⇒ Object

the block will not be called if database execution is skipped



11
12
13
# File 'lib/active_support/test_case.rb', line 11

def with_database(&block)
  block.bind(self).call unless SkipDatabase::Runner.skipping_database
end

Instance Method Details

#skip_database(&block) ⇒ Object

the block will be called only if database execution is skipped



25
26
27
# File 'lib/active_support/test_case.rb', line 25

def skip_database(&block)
  block.bind(self).call if SkipDatabase::Runner.skipping_database
end

#skipping_database?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/active_support/test_case.rb', line 20

def skipping_database?
  SkipDatabase::Runner.skipping_database
end

#with_database(&block) ⇒ Object

the block will not be called if database execution is skipped



30
31
32
# File 'lib/active_support/test_case.rb', line 30

def with_database(&block)
  block.bind(self).call unless SkipDatabase::Runner.skipping_database
end