Add FakePlatform.copyWith to allow overriding some values only (#33)

This adds a copyWith function to FakePlatform so that it is easy to override just one value from another platform. This can cut down a lot on duplicate code in tests, since you can make one template platform, and then just customize bits of it in each test.

Also, updated travis.sh to work with "dart format" instead of "dartfmt", and bumped the version number.
5 files changed
tree: 16ec27d6e045128d1e69809f3db11d71df9af489
  1. dev/
  2. lib/
  3. test/
  4. .gitignore
  5. .travis.yml
  6. analysis_options.yaml
  7. AUTHORS
  8. CHANGELOG.md
  9. CONTRIBUTING.md
  10. LICENSE
  11. pubspec.yaml
  12. README.md
README.md

Platform

Build Status - Coverage Status - Pub

A generic platform abstraction for Dart.

Like dart:io, package:platform supplies a rich, Dart-idiomatic API for accessing platform-specific information.

package:platform provides a lightweight wrapper around the static Platform properties that exist in dart:io. However, it uses instance properties rather than static properties, making it possible to mock out in tests.