mirror of
https://github.com/material-components/material-components-ios.git
synced 2026-02-06 12:38:06 +08:00
Sets up MDC iOS to allow each component to export "Test fakes" and test data for use by other components when performing tests. The initial commit includes "test data" for MDCTypographyScheme that uses non-default values for each UIFont. Contributors writing tests, particularly those that use shared components like schemes, can do so more quickly by accessing test data and test fakes directly from the component rather than having to write custom objects for each test. **Bonus** The new typography data has already confirmed the Dialogs bug #6637, which would have been discovered sooner if we didn't rely on the typographic defaults that already matched component defaults. ## Typical Usage ### Build/dependency management systems **bazel BUILD files:** ``` deps = [ "//components/schemes/Typography:TestingSupport", ], ``` **CocoaPods Podspec files:** ```ruby component.dependency "MaterialComponentsTestingSupport/schemes/Typography" ``` ### Source includes **Swift** ```swift import MaterialComponentsTestingSupport.MaterialTypographyScheme_TestingSupport ``` **Objective-C** ```objc #import <MaterialComponentsTestingSupporrt/MaterialTypographyScheme+TestingSupport.h> ```
140 lines
6.2 KiB
Ruby
140 lines
6.2 KiB
Ruby
Pod::Spec.new do |s|
|
|
s.name = "MaterialComponentsSnapshotTests"
|
|
s.version = "77.0.0"
|
|
s.authors = "The Material Components authors."
|
|
s.summary = "This spec is an aggregate of all the Material Components snapshot tests."
|
|
s.homepage = "https://github.com/material-components/material-components-ios"
|
|
s.license = 'Apache 2.0'
|
|
s.source = { :git => "https://github.com/material-components/material-components-ios.git", :tag => "v#{s.version}" }
|
|
s.platform = :ios, '8.0'
|
|
s.requires_arc = true
|
|
s.dependency 'MaterialComponents'
|
|
s.dependency 'MaterialComponentsBeta'
|
|
|
|
s.subspec "BottomAppBar" do |component|
|
|
component.ios.deployment_target = '8.0'
|
|
component.test_spec 'tests' do |tests|
|
|
tests.test_spec 'snapshot' do |snapshot_tests|
|
|
snapshot_tests.requires_app_host = true
|
|
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}"
|
|
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
|
|
end
|
|
end
|
|
end
|
|
|
|
s.subspec "BottomNavigation" do |component|
|
|
component.ios.deployment_target = '8.0'
|
|
component.test_spec 'tests' do |tests|
|
|
tests.test_spec 'snapshot' do |snapshot_tests|
|
|
snapshot_tests.requires_app_host = true
|
|
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}"
|
|
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
|
|
end
|
|
end
|
|
end
|
|
|
|
s.subspec "Buttons" do |component|
|
|
component.ios.deployment_target = '8.0'
|
|
component.test_spec 'tests' do |tests|
|
|
tests.test_spec 'snapshot' do |snapshot_tests|
|
|
snapshot_tests.requires_app_host = true
|
|
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}"
|
|
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
|
|
end
|
|
end
|
|
end
|
|
|
|
s.subspec "ButtonBar" do |component|
|
|
component.ios.deployment_target = '8.0'
|
|
component.test_spec 'tests' do |tests|
|
|
tests.test_spec 'snapshot' do |snapshot_tests|
|
|
snapshot_tests.requires_app_host = true
|
|
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}"
|
|
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
|
|
snapshot_tests.dependency "MaterialComponentsTestingSupport/schemes/Typography"
|
|
end
|
|
end
|
|
end
|
|
|
|
s.subspec "Cards" do |component|
|
|
component.ios.deployment_target = '8.0'
|
|
component.test_spec 'tests' do |tests|
|
|
tests.test_spec 'snapshot' do |snapshot_tests|
|
|
snapshot_tests.requires_app_host = true
|
|
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}", "components/#{component.base_name}/tests/snapshot/supplemental/*.{h,m,swift}"
|
|
snapshot_tests.resources = "components/#{component.base_name}/tests/snapshot/resources/*"
|
|
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
|
|
end
|
|
end
|
|
end
|
|
|
|
s.subspec "Chips" do |component|
|
|
component.ios.deployment_target = '8.0'
|
|
component.test_spec 'tests' do |tests|
|
|
tests.test_spec 'snapshot' do |snapshot_tests|
|
|
snapshot_tests.requires_app_host = true
|
|
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}", "components/#{component.base_name}/tests/snapshot/supplemental/*.{h,m,swift}"
|
|
snapshot_tests.resources = "components/#{component.base_name}/tests/snapshot/resources/*"
|
|
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
|
|
end
|
|
end
|
|
end
|
|
|
|
s.subspec "Dialogs" do |component|
|
|
component.ios.deployment_target = '8.0'
|
|
component.test_spec 'tests' do |tests|
|
|
tests.test_spec 'snapshot' do |snapshot_tests|
|
|
snapshot_tests.requires_app_host = true
|
|
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}", "components/#{component.base_name}/tests/snapshot/supplemental/*.{h,m,swift}"
|
|
snapshot_tests.resources = "components/#{component.base_name}/tests/snapshot/resources/*"
|
|
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
|
|
end
|
|
end
|
|
end
|
|
|
|
s.subspec "Ripple" do |component|
|
|
component.ios.deployment_target = '8.0'
|
|
component.test_spec 'tests' do |tests|
|
|
tests.test_spec 'snapshot' do |snapshot_tests|
|
|
snapshot_tests.requires_app_host = true
|
|
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}", "components/#{component.base_name}/tests/snapshot/supplemental/*.{h,m,swift}"
|
|
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
|
|
end
|
|
end
|
|
end
|
|
|
|
s.subspec "Slider" do |component|
|
|
component.ios.deployment_target = '8.0'
|
|
component.test_spec 'tests' do |tests|
|
|
tests.test_spec 'snapshot' do |snapshot_tests|
|
|
snapshot_tests.requires_app_host = true
|
|
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}", "components/#{component.base_name}/tests/snapshot/supplemental/*.{h,m,swift}"
|
|
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
|
|
end
|
|
end
|
|
end
|
|
|
|
s.subspec "TextFields" do |component|
|
|
component.ios.deployment_target = '8.0'
|
|
component.test_spec 'tests' do |tests|
|
|
tests.test_spec 'snapshot' do |snapshot_tests|
|
|
snapshot_tests.requires_app_host = true
|
|
snapshot_tests.source_files = "components/#{component.base_name}/tests/snapshot/*.{h,m,swift}", "components/#{component.base_name}/tests/snapshot/supplemental/*.{h,m,swift}"
|
|
snapshot_tests.resources = "components/#{component.base_name}/tests/snapshot/resources/*"
|
|
snapshot_tests.dependency "MaterialComponentsSnapshotTests/private/Snapshot"
|
|
snapshot_tests.dependency "MDFInternationalization"
|
|
end
|
|
end
|
|
end
|
|
|
|
# Private for Snapshot test helpers
|
|
|
|
s.subspec "private" do |private_spec|
|
|
private_spec.test_spec "Snapshot" do |snapshot|
|
|
snapshot.ios.deployment_target = '8.0'
|
|
snapshot.source_files = "components/private/#{snapshot.base_name}/src/*.{h,m,swift}"
|
|
snapshot.dependency 'iOSSnapshotTestCase', '2.2.0'
|
|
end
|
|
end
|
|
end
|