Module: Minitest::Snapshots

Defined in:
lib/minitest/snapshots/version.rb,
lib/minitest/snapshots/serializer.rb,
lib/minitest/snapshots/test_extensions.rb,
lib/minitest/snapshots.rb

Defined Under Namespace

Modules: Serializer, TestExtensions

Constant Summary collapse

VERSION =
"1.1.2".freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.force_updatesObject

Returns the value of attribute force_updates.



5
6
7
# File 'lib/minitest/snapshots.rb', line 5

def force_updates
  @force_updates
end

.lock_snapshotsObject

Returns the value of attribute lock_snapshots.



5
6
7
# File 'lib/minitest/snapshots.rb', line 5

def lock_snapshots
  @lock_snapshots
end

Class Method Details

.default_snapshots_directoryObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/minitest/snapshots.rb', line 7

def default_snapshots_directory
  if defined?(Rails) && Rails.respond_to?(:root)
    Rails.root.join("test", "snapshots").to_s
  elsif Dir.exist?("test")
    File.expand_path("test/snapshots")
  elsif Dir.exist?("spec")
    File.expand_path("spec/snapshots")
  else
    File.expand_path("snapshots")
  end
end