Skip to content

Commit 7fa4d7b

Browse files
committed
d updated markdown snippets
1 parent 28e7351 commit 7fa4d7b

File tree

10 files changed

+23
-23
lines changed

10 files changed

+23
-23
lines changed

approvaltests-util/docs/StringUtils.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ For example
2323
List<Integer> number = Arrays.asList(1, 2, 3, 4, 5);
2424
String text = StringUtils.join(number, ", ");
2525
```
26-
<sup><a href='/approvaltests-util-tests/src/test/java/com/spun/util/StringUtilsTest.java#L51-L54' title='Snippet source file'>snippet source</a> | <a href='#snippet-join_collection' title='Start of snippet'>anchor</a></sup>
26+
<sup><a href='/approvaltests-util-tests/src/test/java/com/spun/util/StringUtilsTest.java#L52-L55' title='Snippet source file'>snippet source</a> | <a href='#snippet-join_collection' title='Start of snippet'>anchor</a></sup>
2727
<!-- endSnippet -->
2828
will produce
2929
<!-- snippet: /approvaltests-util-tests/src/test/java/com/spun/util/StringUtilsTest.testJoinCollection.approved.txt -->
@@ -44,7 +44,7 @@ For example:
4444
List<Integer> number = Arrays.asList(1, 2, 3, 4, 5);
4545
String text = StringUtils.join(number, ", ", n -> StringUtils.padNumber(n, 3));
4646
```
47-
<sup><a href='/approvaltests-util-tests/src/test/java/com/spun/util/StringUtilsTest.java#L60-L63' title='Snippet source file'>snippet source</a> | <a href='#snippet-join_collection_with_lambda' title='Start of snippet'>anchor</a></sup>
47+
<sup><a href='/approvaltests-util-tests/src/test/java/com/spun/util/StringUtilsTest.java#L61-L64' title='Snippet source file'>snippet source</a> | <a href='#snippet-join_collection_with_lambda' title='Start of snippet'>anchor</a></sup>
4848
<!-- endSnippet -->
4949
will Produce
5050
<!-- snippet: /approvaltests-util-tests/src/test/java/com/spun/util/StringUtilsTest.testJoinCollectionWithFunction.approved.txt -->

approvaltests-util/docs/reference/Query.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Integer[] numbers = Range.get(1, 20);
3131
Integer[] evenQueryNumbers = Query.where(numbers, n -> n % 2 == 0).orderBy(OrderBy.Order.Descending, n -> n)
3232
.asArray();
3333
```
34-
<sup><a href='/approvaltests-util-tests/src/test/java/org/lambda/query/QueryTest.java#L34-L38' title='Snippet source file'>snippet source</a> | <a href='#snippet-query_example' title='Start of snippet'>anchor</a></sup>
34+
<sup><a href='/approvaltests-util-tests/src/test/java/org/lambda/query/QueryTest.java#L33-L37' title='Snippet source file'>snippet source</a> | <a href='#snippet-query_example' title='Start of snippet'>anchor</a></sup>
3535
<!-- endSnippet -->
3636

3737
Here is the exact same function but using Java Streams:
@@ -42,7 +42,7 @@ Here is the exact same function but using Java Streams:
4242
Integer[] evenStreamNumbers = Arrays.stream(numbers).filter(n -> n % 2 == 0)
4343
.sorted((o1, o2) -> o2.compareTo(o1)).toArray(Integer[]::new);
4444
```
45-
<sup><a href='/approvaltests-util-tests/src/test/java/org/lambda/query/QueryTest.java#L39-L42' title='Snippet source file'>snippet source</a> | <a href='#snippet-stream_example' title='Start of snippet'>anchor</a></sup>
45+
<sup><a href='/approvaltests-util-tests/src/test/java/org/lambda/query/QueryTest.java#L38-L41' title='Snippet source file'>snippet source</a> | <a href='#snippet-stream_example' title='Start of snippet'>anchor</a></sup>
4646
<!-- endSnippet -->
4747

4848
Another example using sum() vs. reduce():
@@ -53,7 +53,7 @@ Another example using sum() vs. reduce():
5353
String[] names = {"Llewellyn", "Scott"};
5454
int lengthsFromQuery = Query.sum(names, n -> n.length()).intValue();
5555
```
56-
<sup><a href='/approvaltests-util-tests/src/test/java/org/lambda/query/QueryTest.java#L46-L49' title='Snippet source file'>snippet source</a> | <a href='#snippet-query_sum_example' title='Start of snippet'>anchor</a></sup>
56+
<sup><a href='/approvaltests-util-tests/src/test/java/org/lambda/query/QueryTest.java#L45-L48' title='Snippet source file'>snippet source</a> | <a href='#snippet-query_sum_example' title='Start of snippet'>anchor</a></sup>
5757
<!-- endSnippet -->
5858

5959
Here is the exact same function but using Java Streams:
@@ -63,7 +63,7 @@ Here is the exact same function but using Java Streams:
6363
```java
6464
int lengthsFromStream = (int) Arrays.stream(names).map(n -> n.length()).reduce(0, (a, b) -> a + b);
6565
```
66-
<sup><a href='/approvaltests-util-tests/src/test/java/org/lambda/query/QueryTest.java#L50-L52' title='Snippet source file'>snippet source</a> | <a href='#snippet-stream_sum_example' title='Start of snippet'>anchor</a></sup>
66+
<sup><a href='/approvaltests-util-tests/src/test/java/org/lambda/query/QueryTest.java#L49-L51' title='Snippet source file'>snippet source</a> | <a href='#snippet-stream_sum_example' title='Start of snippet'>anchor</a></sup>
6767
<!-- endSnippet -->
6868

6969
#### Other benefits
@@ -82,7 +82,7 @@ Using Query:
8282
```java
8383
List<String> strings = Query.select(numbers, n -> "" + n);
8484
```
85-
<sup><a href='/approvaltests-util-tests/src/test/java/org/lambda/query/QueryTest.java#L57-L59' title='Snippet source file'>snippet source</a> | <a href='#snippet-list_is_queryable' title='Start of snippet'>anchor</a></sup>
85+
<sup><a href='/approvaltests-util-tests/src/test/java/org/lambda/query/QueryTest.java#L56-L58' title='Snippet source file'>snippet source</a> | <a href='#snippet-list_is_queryable' title='Start of snippet'>anchor</a></sup>
8686
<!-- endSnippet -->
8787

8888
Using Streams:
@@ -91,7 +91,7 @@ Using Streams:
9191
```java
9292
List<String> strings2 = Arrays.stream(numbers).map(n -> "" + n).collect(Collectors.toList());
9393
```
94-
<sup><a href='/approvaltests-util-tests/src/test/java/org/lambda/query/QueryTest.java#L60-L62' title='Snippet source file'>snippet source</a> | <a href='#snippet-list_from_stream' title='Start of snippet'>anchor</a></sup>
94+
<sup><a href='/approvaltests-util-tests/src/test/java/org/lambda/query/QueryTest.java#L59-L61' title='Snippet source file'>snippet source</a> | <a href='#snippet-list_from_stream' title='Start of snippet'>anchor</a></sup>
9595
<!-- endSnippet -->
9696

9797
### API

approvaltests-util/docs/reference/RuntimeExceptions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ catch (Throwable t)
3636
throw ObjectUtils.throwAsError(t);
3737
}
3838
```
39-
<sup><a href='/approvaltests-util-tests/src/test/java/com/spun/util/ObjectUtilsTest.java#L66-L77' title='Snippet source file'>snippet source</a> | <a href='#snippet-throw_as_error' title='Start of snippet'>anchor</a></sup>
39+
<sup><a href='/approvaltests-util-tests/src/test/java/com/spun/util/ObjectUtilsTest.java#L67-L78' title='Snippet source file'>snippet source</a> | <a href='#snippet-throw_as_error' title='Start of snippet'>anchor</a></sup>
4040
<!-- endSnippet -->
4141

4242
There are two things to note in this implementation.
@@ -58,7 +58,7 @@ the use of lambdas. Here are examples with and without return values:
5858
ObjectUtils.throwAsError(() -> methodThatMightThrowCheckedException());
5959
int i = ObjectUtils.throwAsError(() -> methodThatMightThrowCheckedExceptionWithReturnValue());
6060
```
61-
<sup><a href='/approvaltests-util-tests/src/test/java/com/spun/util/ObjectUtilsTest.java#L82-L85' title='Snippet source file'>snippet source</a> | <a href='#snippet-throw_as_error_lambda' title='Start of snippet'>anchor</a></sup>
61+
<sup><a href='/approvaltests-util-tests/src/test/java/com/spun/util/ObjectUtilsTest.java#L83-L86' title='Snippet source file'>snippet source</a> | <a href='#snippet-throw_as_error_lambda' title='Start of snippet'>anchor</a></sup>
6262
<!-- endSnippet -->
6363

6464
## 3. Wrapping Actions/Functions
@@ -73,7 +73,7 @@ Queryable<String> paths = files.select(Functions.unchecked(
7373
// throws IOException
7474
s -> new File(s).getCanonicalPath()));
7575
```
76-
<sup><a href='/approvaltests-util-tests/src/test/java/com/spun/util/ObjectUtilsTest.java#L91-L95' title='Snippet source file'>snippet source</a> | <a href='#snippet-throw_as_unchecked' title='Start of snippet'>anchor</a></sup>
76+
<sup><a href='/approvaltests-util-tests/src/test/java/com/spun/util/ObjectUtilsTest.java#L92-L96' title='Snippet source file'>snippet source</a> | <a href='#snippet-throw_as_unchecked' title='Start of snippet'>anchor</a></sup>
7777
<!-- endSnippet -->
7878

7979
---

approvaltests/docs/Configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Function2<Class, String, File> myFinder = new Function2<Class, String, File>()
154154
}
155155
};
156156
```
157-
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/namer/NamerSamples.java#L17-L26' title='Snippet source file'>snippet source</a> | <a href='#snippet-define_alternative_source_directory_finder' title='Start of snippet'>anchor</a></sup>
157+
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/namer/NamerSamples.java#L16-L25' title='Snippet source file'>snippet source</a> | <a href='#snippet-define_alternative_source_directory_finder' title='Start of snippet'>anchor</a></sup>
158158
<!-- endSnippet -->
159159
### Using alternatives
160160
Thanks to the try block, the default is restored afterwards allowing tests to be independent.
@@ -167,7 +167,7 @@ try (SourceDirectoryRestorer sdr = TestUtils.registerSourceDirectoryFinder(myFin
167167
Approvals.verify("Ragunath");
168168
}
169169
```
170-
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/namer/NamerSamples.java#L27-L32' title='Snippet source file'>snippet source</a> | <a href='#snippet-configure_alternative_source_directory' title='Start of snippet'>anchor</a></sup>
170+
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/namer/NamerSamples.java#L26-L31' title='Snippet source file'>snippet source</a> | <a href='#snippet-configure_alternative_source_directory' title='Start of snippet'>anchor</a></sup>
171171
<!-- endSnippet -->
172172

173173
---

approvaltests/docs/Features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ ApprovalNamer namer = Approvals.createApprovalNamer();
9595
Function2<File, File, VerifyResult> approveEverything = (r, a) -> VerifyResult.SUCCESS;
9696
Approvals.verify(new FileApprover(writer, namer, approveEverything));
9797
```
98-
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/approvers/FileApproverTest.java#L66-L71' title='Snippet source file'>snippet source</a> | <a href='#snippet-custom_approver' title='Start of snippet'>anchor</a></sup>
98+
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/approvers/FileApproverTest.java#L65-L70' title='Snippet source file'>snippet source</a> | <a href='#snippet-custom_approver' title='Start of snippet'>anchor</a></sup>
9999
<!-- endSnippet -->
100100

101101

approvaltests/docs/Reporters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ At both the class and method level you can use the @UseReporter attribute to set
7979
```java
8080
@UseReporter(DiffMergeReporter.class)
8181
```
82-
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/reporters/GenericDiffReporterTest.java#L21-L23' title='Snippet source file'>snippet source</a> | <a href='#snippet-use_reporter_single' title='Start of snippet'>anchor</a></sup>
82+
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/reporters/GenericDiffReporterTest.java#L20-L22' title='Snippet source file'>snippet source</a> | <a href='#snippet-use_reporter_single' title='Start of snippet'>anchor</a></sup>
8383
<!-- endSnippet -->
8484

8585
<!-- snippet: use_reporter_multiple -->

approvaltests/docs/how_to/ConsistentTimeZones.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ try (WithTimeZone tz = new WithTimeZone("UTC"))
2626
}
2727
// The computer's time zone will revert to previous setting here
2828
```
29-
<sup><a href='/approvaltests-util-tests/src/test/java/com/spun/util/parser/VelocityUtilsTest.java#L35-L41' title='Snippet source file'>snippet source</a> | <a href='#snippet-with_time_zone' title='Start of snippet'>anchor</a></sup>
29+
<sup><a href='/approvaltests-util-tests/src/test/java/com/spun/util/parser/VelocityUtilsTest.java#L36-L42' title='Snippet source file'>snippet source</a> | <a href='#snippet-with_time_zone' title='Start of snippet'>anchor</a></sup>
3030
<!-- endSnippet -->

approvaltests/docs/how_to/PrintableWrappers.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ If you just wanted to wrap a single object. You can create a printable wrapper b
2727
Printable<Integer> one = new Printable(1, "one");
2828
assertEquals("one", one.toString());
2929
```
30-
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L18-L21' title='Snippet source file'>snippet source</a> | <a href='#snippet-printable_single_label' title='Start of snippet'>anchor</a></sup>
30+
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L14-L17' title='Snippet source file'>snippet source</a> | <a href='#snippet-printable_single_label' title='Start of snippet'>anchor</a></sup>
3131
<!-- endSnippet -->
3232

3333
to access the value, simply call
@@ -38,7 +38,7 @@ to access the value, simply call
3838
Integer value = one.get();
3939
assertEquals(1, value);
4040
```
41-
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L22-L25' title='Snippet source file'>snippet source</a> | <a href='#snippet-printable_access' title='Start of snippet'>anchor</a></sup>
41+
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L18-L21' title='Snippet source file'>snippet source</a> | <a href='#snippet-printable_access' title='Start of snippet'>anchor</a></sup>
4242
<!-- endSnippet -->
4343

4444
#### Alternative `toString()` Function
@@ -51,7 +51,7 @@ You can also write a different function(lambda) to create the `toString()` and t
5151
Printable<Integer> two = new Printable(2, i -> "#" + i + ")");
5252
assertEquals("#2)", two.toString());
5353
```
54-
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L26-L29' title='Snippet source file'>snippet source</a> | <a href='#snippet-printable_single_lambda' title='Start of snippet'>anchor</a></sup>
54+
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L22-L25' title='Snippet source file'>snippet source</a> | <a href='#snippet-printable_single_lambda' title='Start of snippet'>anchor</a></sup>
5555
<!-- endSnippet -->
5656

5757
### Wrap an array of objects
@@ -64,7 +64,7 @@ For convenience, if you want to do this to a whole list of items we have
6464
Printable<Integer> numbers[] = Printable.create(n -> "#" + n, 1, 2, 3, 4, 5);
6565
Approvals.verifyAll("Custom toString method", numbers, p -> String.format("%s -> %s", p, p.get()));
6666
```
67-
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L40-L43' title='Snippet source file'>snippet source</a> | <a href='#snippet-printable_array_lambda' title='Start of snippet'>anchor</a></sup>
67+
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L36-L39' title='Snippet source file'>snippet source</a> | <a href='#snippet-printable_array_lambda' title='Start of snippet'>anchor</a></sup>
6868
<!-- endSnippet -->
6969

7070
would produce
@@ -95,7 +95,7 @@ Printable<Integer> labeled[] = Printable.with().label(1, "first").label(2, "seco
9595
.label(4, "forth").label(5, "fifth").toArray();
9696
Approvals.verifyAll("Labeled", labeled, p -> String.format("%s -> %s", p, p.get()));
9797
```
98-
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L48-L52' title='Snippet source file'>snippet source</a> | <a href='#snippet-printable_array_labels' title='Start of snippet'>anchor</a></sup>
98+
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L44-L48' title='Snippet source file'>snippet source</a> | <a href='#snippet-printable_array_labels' title='Start of snippet'>anchor</a></sup>
9999
<!-- endSnippet -->
100100

101101
would produce:

approvaltests/docs/how_to/TestAVarietyOfValues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ If you have more than one parameter that you want to vary, check out [Testing Co
2424
String[] inputs = {"input.value1", "input.value2"};
2525
Approvals.verifyAll("TITLE", inputs, s -> "placeholder " + s);
2626
```
27-
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/ApprovalsTest.java#L40-L43' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyallstartingpoint' title='Start of snippet'>anchor</a></sup>
27+
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/ApprovalsTest.java#L39-L42' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyallstartingpoint' title='Start of snippet'>anchor</a></sup>
2828
<!-- endSnippet -->
2929

3030
2. Modify the input container for your chosen values.

approvaltests/docs/reference/AwtApprovals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ for every frame. Here is an example for a simple expanding box:
3636
SquareDrawer squareDrawer = new SquareDrawer();
3737
AwtApprovals.verifySequence(5, f -> squareDrawer.setSquareSize(f * 10));
3838
```
39-
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/awt/ApprovalsTest.java#L47-L50' title='Snippet source file'>snippet source</a> | <a href='#snippet-sequencepaintables' title='Start of snippet'>anchor</a></sup>
39+
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/awt/ApprovalsTest.java#L46-L49' title='Snippet source file'>snippet source</a> | <a href='#snippet-sequencepaintables' title='Start of snippet'>anchor</a></sup>
4040
<!-- endSnippet -->
4141

4242
**Note**: Method overloads allow specifying the time between frames or the time for each frame.

0 commit comments

Comments
 (0)