Module: Minitest::Snapshots

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

Defined Under Namespace

Modules: Serializer, TestExtensions

Constant Summary collapse

VERSION =
"1.2.2".freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.force_updatesObject

Returns the value of attribute force_updates.



24
25
26
# File 'lib/minitest/snapshots_plugin.rb', line 24

def force_updates
  @force_updates
end

.lock_snapshotsObject

Returns the value of attribute lock_snapshots.



24
25
26
# File 'lib/minitest/snapshots_plugin.rb', line 24

def lock_snapshots
  @lock_snapshots
end

Class Method Details

.default_snapshots_directoryObject



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/minitest/snapshots_plugin.rb', line 26

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