Commit Graph

158 Commits

Author SHA1 Message Date
Robert Stoll
f6375b1ca9 #292 show only failing for inOrder.only if more than 10 elements
I decided that I will apply a default heuristic so that (I hope) most
users don't have to change reporting options.
2021-07-12 22:33:31 +02:00
Robert Stoll
1f1f0a50ca show representation for failure in feature extraction if subject defined
or in case failure hints or sub-assertions are defined.
2021-07-06 22:40:23 +02:00
Edward Hou
1a8e024a7b Make Iterable.all and Iterable.containsNoDuplicates use hasNext (#939) 2021-07-06 20:37:40 +02:00
Robert Stoll
787d258ae1 add TODO for 0.18.0 collectForComposition should return flag
the flag would indicate whether the assertionCreator did not create an
assertion, this way we don't have to collect twice just to know this.
2021-07-03 15:04:09 +02:00
Ed
568a1bf988 Suppress deprecation warning for ExplanatoryAssertionGroupFinalStep 2021-06-30 18:15:30 -07:00
Ed
45519af5f5 Note use of deprecated type with TODO 2021-06-21 16:03:02 -07:00
Ed
17c726012b Make collectAssertions fail with empty assertionsCreator lambda 2021-06-21 16:01:25 -07:00
Ed
d923d416d1 Fail explanatory assertion group on empty assertionCreator 2021-06-11 09:40:59 -07:00
Edward Hou
dac885bc6e More consise reporting for contains.atLeast(1) (#934) 2021-06-11 07:53:05 +02:00
Edward Hou
91fad2624c Make notToContain less verbose and show mismatched indices (#931) 2021-06-09 09:16:57 +02:00
Robert Stoll
f67cd01e38 rename appendAssertion/CreatedBy to append and appendAsGroup
This way we can use it also on ProofContainer and users won't notice
anything as long as they recompile
2021-05-29 21:22:55 +02:00
Robert Stoll
dd3f6bb15e forgive bc/bbc due to different reporting, add de_CH translation 2021-05-22 22:03:11 +02:00
Ed
908110dd3b Improve reporting on containsNoDuplicates by tracking duplicate indices 2021-05-22 21:34:09 +02:00
Robert Stoll
5608af1852 deprecate throwableAssertions, use new ...Expectations in api-fluent 2021-05-20 21:52:23 +02:00
Robert Stoll
9f4a978f34 replace equals to zero with is zero 2021-04-28 22:03:57 +02:00
Robert Stoll
d67ff96388 rename iterable assertion functions to new schema in api-infix
cannot rename all files because of git mv incapabilities. Would loose
history otherwise.
2021-04-28 21:26:00 +02:00
Robert Stoll
37b4e8144f deprecate iterableAssertions, use mew ...Expectations in api-fluent 2021-04-28 21:26:00 +02:00
Robert Stoll
25f8b07c35 deprecate floatingPointAssertions, use mew ...Expectations in api-fluent
moreover:
- also change description in reporting from `to be` to `to equal`
- don't provide a replacement for BigDecimal, it is a smell if someone
  uses it.
2021-04-25 19:35:08 +02:00
Robert Stoll
44cd5e05b3 add notToBeGreaterThan and notToBeLessThan
moreover:
- make the distiction between toEqual and toBeEqualComparingTo clearer
- rewrite ComparableExpectationsSpec to new nameing and include test
  cases for toBeLessThanOrEqualTo and toBeGreaterThanOrEqualTo where
  the equals/compareTo contract is broken
2021-04-24 23:04:18 +02:00
Robert Stoll
2b8a27535c deprecate comparableAssertions, use mew ...Expectations in api-fluent 2021-04-21 21:39:38 +02:00
Robert Stoll
b1b01645a2 deprecate charSequenceAssertions, use mew ...Expectations in api-fluent
moreover:
- do no longer provide an overload for Char for toStartWith and
  toEndsWith. I prefer to have less API methods and less maintenance
  compared to a nice to have. Which also means I prefer to force users
  to write "a" over 'a' than more maintenance, more API methods
2021-04-15 23:14:47 +02:00
Robert Stoll
30cbe303e0 rename toBeA to toBeAnInstanceOf in both APIs 2021-04-13 21:19:31 +02:00
Robert Stoll
b81729506b deprecate old anyAssertions and use new anyExpectations in api-fluent 2021-04-12 22:41:32 +02:00
Robert Stoll
c2a1942c5c rename core-api to core
and use `expectation` in packages.md instead of `assertion`
2021-04-06 21:06:11 +02:00
Robert Stoll
a95569cca4 remove deprecated AssertionContainer<*>.collectForDifferentSubject 2021-04-05 21:24:21 +02:00
Robert Stoll
81216138ec deprecate CoreFactory and loadService 2021-04-05 21:24:20 +02:00
Robert Stoll
180e0cceab update TODOs which we do no longer plan for 0.17.0 2021-04-04 23:16:23 +02:00
Robert Stoll
8210983143 remove deprecated Reporter.atriumErrorAdjuster 2021-04-04 23:04:21 +02:00
Robert Stoll
f9cca66e14 remove FeatureExpectOptions.kt in core, only keep the one in logic
same same for related function/types
2021-04-04 22:53:26 +02:00
Robert Stoll
144d35c167 replace SubjectProvider with Expect but do not yet remove
we cannot yet remove it because we still have addAssertion on Expect
and if we remove it, would also have one on AssertionContainer. Two
different definitions which would not work together. This also means:
- deprecate addAssertion/addAssertionsCreatedBy/createAndAddAssertion
  in Expect, add append... to AssertionContainer
2021-04-04 21:32:58 +02:00
Robert Stoll
2519afb254 remove deprecated modules, ReportFactory, ExpectBuilder and dependOnMe
moreover:
- adjust packages.md, also remove deprecaed modules there and remove
  documentation which is no longer used
- remove createRegisterJsServicesTask in build.gradle
- adjust bbc/bc due to breaking changes (removal of different types).
  in the same go we have to forgive bc for infix as we no longer have
  ReporterFactory and since we don't use ascii bullet points in infix
  tests any more since 0.16.0 - we have established own tests for this
  aspect
- rename RealTranslatorIntSpec to TranslatorIntSpec and remove the
  existing TranslatorIntSpec which was intended for ReporterFactory
  based implementations.
2021-04-01 22:57:33 +02:00
Robert Stoll
99aef715d0 remove TODO on getImpl to replace it with components.
getImpl will be used in the future to create ProofFactory related types.
We will most likely rename it but it has a different purpose than
components. I think it will be much less likely that components are
actually exchanged where a user needs to define an own assertion verb to
do so. On the other hand, I could imagine that one wants to provide
an own implementation for a ProofFactory, e.g. to override one
particular expectation function, where with getImpl one is decoupled
from the assertion verb and instead provides an extension function
on the logic level.
2021-03-30 13:57:56 +02:00
Robert Stoll
4d48616e81 make default impl of CharSequenceContains.Step not internal
ok if someone is using it - we just don't give any bbc/bc guarantees
2021-03-30 13:57:56 +02:00
Robert Stoll
bd25186c53 move MetaFeature to logic and MetaFeatureOption to APIs 2021-03-21 22:45:03 +01:00
Robert Stoll
74f111b826 move TODOs to 0.17.0 which we no longer plan for 0.16.0 2021-03-16 22:03:30 +01:00
Robert Stoll
4103508d1b sort entries for isEmptyDirectory 2021-03-16 21:09:40 +01:00
Robert Stoll
206500bec0 show max 10 dir entries (with ellipsis) for isEmptyDirectory
instead of only one. Moreover, use an explanatory assertion group with
a warning group type. Looks then as follows:
expected that subject: /tmp/spek16789805802838758490/notEmpty        (sun.nio.fs.UnixPath <1842823132>)
◆ is: an empty directory
     directory contains:
       ⚬ f5        (sun.nio.fs.UnixPath <1295966993>)
       ⚬ f2        (sun.nio.fs.UnixPath <878629898>)
       ⚬ f3        (sun.nio.fs.UnixPath <1318008636>)
       ⚬ f0        (sun.nio.fs.UnixPath <452118766>)
       ⚬ f1        (sun.nio.fs.UnixPath <552502986>)
       ⚬ f8        (sun.nio.fs.UnixPath <1657993305>)
       ⚬ f9        (sun.nio.fs.UnixPath <1439892968>)
       ⚬ f4        (sun.nio.fs.UnixPath <1508512260>)
       ⚬ f6        (sun.nio.fs.UnixPath <224794405>)
       ⚬ f7        (sun.nio.fs.UnixPath <2013476576>)
       ⚬ ...

moreover:
- cleanup samples, isNotEmptyDirectory should actually be in
  isEmptyDirectory because we might have a isNotEmptyDirectory in the
  future. Same same for isSymbolicLink.
- move PathAssertionSamples also to deprecated package
- rename toBeASymbolicLink to isSymbolicLink for now. Will do the rename
  once we rename all
-
2021-03-16 13:43:24 +01:00
Mai
aed87e4a9b add isEmptyDirectory (#831)
* add isEmptyDirectory to PathAssertions.kt and implemented it.
* add infix samples.
* add fluent samples.
2021-03-16 13:08:57 +01:00
Robert Stoll
27b3e4a4a0 fix readme re-generation, use always ReadmeObjectFormatter
moreover:
- fix the broken link for mapArguments snippet
- let TextObjectFormatterCommon extend TextObjectFormatter
2021-02-23 21:49:06 +01:00
Robert Stoll
575f5285e1 use Translator in ComponentFactoryContainer introduce ComponentFactory
ComponentFactory because we need a way to say we want kind of a
singleton which is re-used in this ComponentFactoryContainer.
We cannot / don't want to make guarantees about creating a singleton
only once, i.e. use computeIfAbsent or similar, because it would mean
we cannot have a singleton component which depends on another
singleton component.

We try at least to create a singleton as less as possible. For this to
work:
- introduce ComponentFactory (as already mentioned)
  - let ComponentFactoryContainer.getFactoryOrNull and
    getFactoryForChainedOrNull return a ComponentFactory instead of a
    simple function
- introduce ConcurrentMap as polyfill

moreover:
- deprecate get/setAtriumProperty and ReporterFactory
- deprecate all Translator and AssertionFormatter specific stuff in
  core-robstoll-lib and move to core
  - configure replacements in DefaultComponentFactoryContainer
  - get rid off most ReporterFactories only keep DefaultReporterFactory
    which we will remove with 0.17.0
- rename RemoveRunnerAtriumError to RemoveRunnerFromAtriumError
- move text specific AssertionFormatter to package `text` as preparation
  for further AssertionFormatters (like html)
- introduce RealTranslatorIntSpec which makes use of
  ComponentFactoryContainer instead of ReporterFactory
2021-02-23 15:49:36 +01:00
jaime
2d3b1c898a add convenience shortcut for Path.toBeASymbolicLink feature
For both infix and fluent API styles
2021-02-20 19:11:03 +01:00
Robert Stoll
6db344764d Merge pull request #768 from ivanmiklec/remove-size-check-out-of-iterable-contains
Remove size check feature assertion from iterable contains
2021-02-16 22:24:39 +01:00
ivanmiklec
88fd0f114a #299 move size feature assertion from iterable.contains 2021-02-16 01:12:36 +01:00
Igor Emelyanov
56afad808f #636 improve perfomance filter duplicates (#812) 2021-02-15 21:21:17 +01:00
Robert Stoll
09c27e3625 move PleaseUseReplacementException to core
i.e.:
- duplicate and deprecate the one in domain-builders
- ignore failing bbc and bc tests
2021-02-12 20:57:48 +01:00
Robert Stoll
d0de536750 use MethodCallFormatter from components instead of CoreFactory
moreover:
- deprecate newMethodCallFormatter in CoreFactory
- introduce a descriptionProvider for Feature and FeatureWithCreator
  in api-infix.
  - deprecate the usage of `description` accordingly
2021-02-09 21:57:06 +01:00
Robert Stoll
c8e8e11dd5 replace AssertionCollector by utility functions in logic
moreover:
- rename collectForDifferentSubject to collectBasedOnSubject
- use DefaultComponentFactoryContainer only in RootExpectImpl and
  deprecated which we don't intend to adjust
- no longer use atriumErrorAdjustor from Reporter but from the
  ComponentFactoryContainer in all other places
2021-02-08 23:50:46 +01:00
Robert Stoll
241d41a825 introduce ComponentFactoryContainer and AtriumErrorAdjusters in core
In order that one is able to exchange a component which is part of
another component, we need to following to change:
- introduce a ComponentFactoryContainer which stores all factories
  and provide a way to re-define factories
- add val components to AssertionContainer which returns the specified
  ComponentFactoryContainer
- remove withReporter from RootExpectBuilder.OptionsChooser and instead
  add a more generic withComponent (and withChainedComponent)
- use AtriumErrorAdjustor not from Reporter (deprecated the property)
  but retrieve it from the ComponentFactoryContainer of the
  corresponding AssertionContainer

moreover:
- introduce @ExperimentalComponentFactoryContainer
- deprecated the AtriumErrorAdjuster creating functions in CoreFactory
  - replace usages accordingly
2021-02-08 23:50:46 +01:00
Robert Stoll
7867962412 use invoke instead of create as Builder's factory method name 2021-02-08 22:14:40 +01:00
Robert Stoll
421253e73c move FeatureExpectOptionsChooser to logic 2021-01-25 22:07:50 +01:00