100% found this document useful (1 vote)
46 views44 pages

The Art of Unit Testing, Third Edition: with examples in JavaScript Roy Osherove instant download

The document provides links to various books related to unit testing and software development, including 'The Art of Unit Testing' by Roy Osherove. It highlights the importance of unit testing and offers resources for learning effective testing techniques. Additionally, it includes praise for the second edition of the featured book, emphasizing its depth and usefulness for developers.

Uploaded by

aoyspkvhlz909
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
46 views44 pages

The Art of Unit Testing, Third Edition: with examples in JavaScript Roy Osherove instant download

The document provides links to various books related to unit testing and software development, including 'The Art of Unit Testing' by Roy Osherove. It highlights the importance of unit testing and offers resources for learning effective testing techniques. Additionally, it includes praise for the second edition of the featured book, emphasizing its depth and usefulness for developers.

Uploaded by

aoyspkvhlz909
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

The Art of Unit Testing, Third Edition: with

examples in JavaScript Roy Osherove download

https://textbookfull.com/product/the-art-of-unit-testing-third-
edition-with-examples-in-javascript-roy-osherove/

Download full version ebook from https://textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

Automated Unit Testing with ABAP: A Practical Approach


1st Edition James E. Mcdonough

https://textbookfull.com/product/automated-unit-testing-with-
abap-a-practical-approach-1st-edition-james-e-mcdonough/

Beginning Ethereum Smart Contracts Programming: With


Examples in Python, Solidity, and JavaScript Lee

https://textbookfull.com/product/beginning-ethereum-smart-
contracts-programming-with-examples-in-python-solidity-and-
javascript-lee/

Biota Grow 2C gather 2C cook Loucas

https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-
loucas/

Pro iOS Testing: XCTest Framework for UI and Unit


Testing Avi Tsadok

https://textbookfull.com/product/pro-ios-testing-xctest-
framework-for-ui-and-unit-testing-avi-tsadok/
Pro iOS Testing: XCTest Framework for UI and Unit
Testing 1st Edition Avi Tsadok

https://textbookfull.com/product/pro-ios-testing-xctest-
framework-for-ui-and-unit-testing-1st-edition-avi-tsadok/

Unit Testing Principles, Practices, and Patterns 1st


Edition Vladimir Khorikov

https://textbookfull.com/product/unit-testing-principles-
practices-and-patterns-1st-edition-vladimir-khorikov/

Software Development, Design and Coding: With Patterns,


Debugging, Unit Testing, and Refactoring, 2nd Edition
John F. Dooley

https://textbookfull.com/product/software-development-design-and-
coding-with-patterns-debugging-unit-testing-and-refactoring-2nd-
edition-john-f-dooley/

Testing JavaScript Applications MEAP V05 Lucas Da Costa

https://textbookfull.com/product/testing-javascript-applications-
meap-v05-lucas-da-costa/

Learn With Angular 4 Collected Essays Angular CLI Unit


Testing Debugging TypeScript and Angular Build
Processes 2nd Edition Jeffry Houser

https://textbookfull.com/product/learn-with-angular-4-collected-
essays-angular-cli-unit-testing-debugging-typescript-and-angular-
build-processes-2nd-edition-jeffry-houser/
inside front cover
Test recipes
A test recipe is a test plan, outlining at which level a particular feature
should be tested.
Praise for the second edition
This book is something special. The chapters build on each other
to a startling accumulation of depth. Get ready for a treat.

—From the foreword of the second edition by Robert


C. Martin, cleancoder.com

The best way to learn unit testing from what is now a classic in the
field.

—Raphael Faria, LG Electronics

Teaches you the philosophy as well as the nuts and bolts for
effective unit testing.

—Pradeep Chellappan, Microsoft

When my team members ask me how to write unit tests the right
way, I simply answer: Get this book!

—Alessandro Campeis, Vimar SpA

The single best resource on unit testing.

—Kaleb Pederson, Next IT Corporation

The most useful and up-to-date guide to unit testing I have ever
read.

—Francesco Goggi, FIAT

A must for any serious .NET developer wishing to learn or perfect


their unit testing knowledge.

—Karl Metivier, Desjardins Security Financial


The Art of Unit Testing
Third Edition
with examples in JavaScript

Roy Osherove with Vladimir Khorikov

To comment go to liveBook

Manning

Shelter Island
For more information on this and other Manning titles go to
www.manning.com
Copyright

For online information and ordering of these and other


Manning books, please visit www.manning.com. The
publisher offers discounts on these books when ordered in
quantity.

For more information, please contact

Special Sales Department


Manning Publications Co.
20 Baldwin Road
PO Box 761
Shelter Island, NY 11964
Email: [email protected]

©2024 by Manning Publications Co. All rights


reserved.

No part of this publication may be reproduced, stored in a


retrieval system, or transmitted, in any form or by means
electronic, mechanical, photocopying, or otherwise, without
prior written permission of the publisher.

Many of the designations used by manufacturers and sellers


to distinguish their products are claimed as trademarks.
Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the
designations have been printed in initial caps or all caps.

♾ Recognizing the importance of preserving what has been


written, it is Manning’s policy to have the books we publish
printed on acid-free paper, and we exert our best efforts to
that end. Recognizing also our responsibility to conserve the
resources of our planet, Manning books are printed on
paper that is at least 15 percent recycled and processed
without the use of elemental chlorine.

Manning Publications Co.


20 Baldwin Road Technical
PO Box 761
Shelter Island, NY 11964

Development editor: Connor O’Brien


Technical development editor: Mike Shepard
Review editors: Adriana Sabo and Dunja Nikitović
Production editor: Kathy Rossland
Copy editor: Andy Carroll
Proofreader: Katie Tennant
Technical proofreader: Jean-François Morin
Typesetter: Dennis Dalinnik
Cover designer: Marija Tudor
ISBN: 9781617297489
dedication
To Tal, Itamar, Aviv, and Ido. My family.

—Roy Osherove

To my wife Nina and son Timothy.

—Vladimir Khorikov
contents
Front matter
foreword to the second edition
foreword to the first edition
preface
acknowledgments
about this book
about the authors
about the cover illustration

Part 1 Getting started

1 The basics of unit testing


1.1 The first step
1.2 Defining unit testing, step by step
1.3 Entry points and exit points
1.4 Exit point types
1.5 Different exit points, different techniques
1.6 A test from scratch
1.7 Characteristics of a good unit test
What is a good unit test?
A unit test checklist

1.8 Integration tests


1.9 Finalizing our definition
1.10 Test-driven development
TDD: Not a substitute for good unit tests
Three core skills needed for successful TDD
2 A first unit test
2.1 Introducing Jest
Preparing our environment
Preparing our working folder
Installing Jest
Creating a test file
Executing Jest

2.2 The library, the assert, the runner, and the reporter
2.3 What unit testing frameworks offer
The xUnit frameworks
xUnit, TAP, and Jest structures
2.4 Introducing the Password Verifier project
2.5 The first Jest test for verifyPassword
The Arrange-Act-Assert pattern
Testing the test
USE naming
String comparisons and maintainability
Using describe()
Structure implying context
The it() function
Two Jest flavors
Refactoring the production code
2.6 Trying the beforeEach() route
beforeEach() and scroll fatigue
2.7 Trying the factory method route
Replacing beforeEach() completely with factory methods

2.8 Going full circle to test()


2.9 Refactoring to parameterized tests
2.10 Checking for expected thrown errors
2.11 Setting test categories

Part 2 Core techniques

3 Breaking dependencies with stubs


3.1 Types of dependencies
3.2 Reasons to use stubs
3.3 Generally accepted design approaches to stubbing
Stubbing out time with parameter injection
Dependencies, injections, and control
3.4 Functional injection techniques
Injecting a function
Dependency injection via partial application
3.5 Modular injection techniques
3.6 Moving toward objects with constructor functions
3.7 Object-oriented injection techniques
Constructor injection
Injecting an object instead of a function
Extracting a common interface
4 Interaction testing using mock objects
4.1 Interaction testing, mocks, and stubs
4.2 Depending on a logger
4.3 Standard style: Introduce parameter refactoring
4.4 The importance of differentiating between mocks and
stubs
4.5 Modular-style mocks
Example of production code
Refactoring the production code in a modular injection style
A test example with modular-style injection
4.6 Mocks in a functional style
Working with a currying style
Working with higher-order functions and not currying

4.7 Mocks in an object-oriented style


Refactoring production code for injection
Refactoring production code with interface injection
4.8 Dealing with complicated interfaces
Example of a complicated interface
Writing tests with complicated interfaces
Downsides of using complicated interfaces directly
The interface segregation principle
4.9 Partial mocks
A functional example of a partial mock
An object-oriented partial mock example
5 Isolation frameworks
Another Random Scribd Document
with Unrelated Content
Propping his chin upon his cane, he sat glaring at them, till, with a
venomous look at me, the woman whisked from the room, her
husband shuffling after. So he sat stiffly till the door was shut; then
lay back in his chair and fell again to senile chuckling. “Eh, John;
but they think me near to dying,” he said. “Eh, John, did ye mark
how I took the wind from her sails? Eh, but I’m stronger for having
Richard’s son beside me. I thought to die captain of my ship many a
time. And I think to die master of my own house,” and so, sat
chuckling and shaking, his strength leaving him as suddenly as his
will had summoned it. He rambled on, “She’s an ill fowl—eh, John?
She’s a skeleton held together by her skin—no more. Barwise’s
woman,—she’d looks once,—hair black as the storm and eyes as
black. She’d wear silks and gold rings. She took a fat picking from
my men, when I sailed my ship. She’d a tavern Shadwell way.” He
broke off, and looked dully at me. He muttered, “Can you not see,
lad, the manner of man I was? Can you not see the wreck I am?
How I ruled ’em once and how now that they think me broken—
they’d mutiny, they’d rob me; they’d have what they’ll never set
their fingers on?”
“Surely my uncle would discipline them at a word from you. Clear
the house of them.”
“Ay, ay, Charles! Charles watches me, as they, and thinks to rob
me!” He gasped, and huddled in his chair; ghastly now, and the
sweat beading his brow.
I said swiftly, “Shall I ring for Thrale? You’re ill, sir!”
He croaked, “And let ’em see me so!”—and clawed in his pocket and
poked a slim key into my hands, and whispered, “Hey! The press
there—the bottle—pour me a dram!”
I unlocked the press beside him, and taking out a bloated green
bottle—much as the bottle at Mother Mag’s—poured some spirit into
a glass; and his hands now shaking, so that he must have spilt the
drink, I held it to his lips, until he swallowed it down, choking and
coughing. Whatever the stuff, it lent him speedy strength and
colour. He sat blinking at me with those evil old eyes of his. I could
feel scant pity for him, save for the thought that he had been so
strong, and was now old and weak, and that the rogues who had
formed his crew, and whom for some odd fancy, or fear, he had kept
about him would now tear him down, as they would have torn him
down, had he been less strong and ruthless, on his ship.
I said, “You’ve a pretty crew of rogues about you, sir. Give me but
the word, and I’ll drive off and have Mr. Bradbury back here, and
we’ll make a sweep of the whole company.”
He answered, “No. Rogues, but they serve me well. And I ruled
’em once. And I’ll rule ’em till I’m dead. You’ll stay by me, John—
ay, ay, and you’ll profit by it, and Charles shall pay for his sins. Now
you may leave me, lad. They’ll obey you. They’ll fear you, fearing
me still. There are many books in the old house. There’s a horse in
the stable. There’s the wench, Milne; and there’s the whelp, Oliver,
who’ll ride with you, and drink with you, and rook you. Ay, and
there’s guineas for the spending”—clawing suddenly into the pocket
of his gown, and drawing out a purse and slinging it to me. It rang
with gold, as I caught it in my hand.
Chapter XXIV. The Wood

Now I was not fated long to test the efficacy of my grandfather’s


control over his son and his servants. I’d have you know that twelve
folk served my grandfather at Craike House, and that excepting Nick
Barwise, the groom, these rogues were of the crew who served
under Mr. Craike when he sailed his own ship, and that in his
fantastic spirit he would have them by him after his return to
England to assume his position as Craike of Craike House. The gates
were kept by Isaac, second son of the Barwise union, and his
woman, the swart gipsy, whom I had observed on my arrival with
Mr. Bradbury. All this disreputable company, as much as my
grandfather’s eccentricities, had won the house its ill-name—Rogues’
Haven, among the folk of the countryside; these rogues, too, were
leagued with smugglers such as Blunt, who plied their traffic under
the very nose of the justice Gavin Masters, and the coastguards.
My uncle, since his father’s advanced years and decay pointed to his
speedy death, had torn himself away from the diversions of London
and society, of which he was adjudged an ornament. Penniless,
while he played devoted son, he had established an advantageous
understanding with Blunt and his folk, who would alternate long
voyages to America and the Indies, on Lord knows what nefarious
traffic, with running smuggled stuff from the Continent to the
English coast. That my uncle fretted under the yoke of duty
manifested itself daily in his covert sneers at his father; the chagrin
of Charles, my grandfather remarked to me, had lent a zest to living.
The days I spent in Craike House passed dully and without
noteworthy event. I did not lose my dread of the house in the night;
the impressions of my first night under its roof abated in no way, but
the good-humour of my uncle, the servility of Thrale and his fellow-
rogues, the companionship of Oliver, and the sports which I shared
with him, lent me a confidence which was to prove groundless. I
passed much of my time in playing chess with my grandfather, in
reading to him from old voyagers and romancers—of whose works
he had by him a great store, or in listening to his narrative of his
own sailings, which, if incomplete, gave me a portrait of him by no
means calculated to advance my affection for him. Yet that I
advanced daily in his favour was patent; my uncle masked his
chagrin under a bland demeanour, and a display of the graces and
accomplishments which surely rendered his absence deplored by
society. But though my grandfather assured me of protection, and
though my uncle professed a truce, I would have been wise to follow
my first inclination—not to remain under the roof of Craike House, as
I shall now relate.
One morn, a month, I should say, from my coming to Rogues’
Haven, my grandfather informing me, through Thrale, that I was
free to pass the day as I pleased, I bade Thrale unlock the door for
me, and passed out of the house. The gold sunlight lay upon the
garden; if it dispelled for a time the gloom, it emphasised the
disrepair of the old house, the ivy climbing to the chimney stacks
and lacing the windows; a few it had obscured wholly. As I looked
up, I saw the sinister face of Mrs. Barwise looking from a high
window; she bobbed back instantly. I estimated the covert hostility
of the rogues of Craike House; and, having a certain apprehension of
walking abroad unarmed, I took out my knife and speedily fashioned
me a heavy cudgel. I went down then by a flight of stone steps into
the old sunken garden to the right from the house,—steps crumbling
and green with moss, and overshadowed by a tangle of roses and
honeysuckle, descending into a cool depth which had been laid out
once in ornate flower beds and lawns, but was now overrun with
fox-gloves, prevailing through their sturdy strength over other
flowers. Yet the air was sweet with the white-starred jasmine over
the crumbling walls, shutting the deep garden from the old
plantation, which had become a dense wood.
Once paths had curved to the sundial at the heart of the garden.
The dial was broken and corroded now; a bramble had caught it in
its claws; sparrows fought and chirruped upon it in the sun. Arbours
had become thickets; through the broken wall I saw the wood go
deep, but the sunlight struck through the trees upon a path among
tall grasses and flowers spilled from the garden.
I climbed the broken wall and sauntered down the woodland path,
taking delight in beauty, and presently departing from the track,
passed down to left into a deep glade—silver and green in the
sunlight; the dew was not yet dry on fern and grass. And suddenly I
saw the girl Evelyn Milne,—she sat upon a fallen log, moss-grown
and bramble-clustered. Her head was bare; her bonnet lying on the
turf beside her; she sat bent with her hands clasped at her knees—a
picture of melancholy and loneliness; yet the sun found the glossy
sheen in her dark hair, and the whiteness of her neck and hands. At
the crack of a stick under my feet, she started up, and stood
regarding me with sullen eyes. I swept off my hat, but she offered
me no greeting.
I stammered, “I ask your pardon, Miss Milne. I did not think to
disturb you.”
She looked about her hurriedly; leaning towards me then, she
whispered, “Now you’re out of the house—away from them all, why
not go on and on through the wood, and never return?”
“You mean,” I said, staring at her pale face, at her white hands
fluttering at her bosom, “it would be safer for me, that I’ll never be
safe in the house?”
“I mean—it doesn’t matter what I mean. Only, were I you, and had
any friends away from here—were not alone as I am alone—I’d go.
I’d never return.”
“Miss Milne,” said I, “I do assure you that I’m not afraid. Why
should I run away?”
“Afraid!” she whispered still. “You’re only a fool. You’re only a boy.
Your life’s before you. Why would you stay? Hoping to profit, and
be rich, when that old man is dead? Is that why you’d stay? There’s
no price that’s worth your life—to you. Why did you ever come to
such a house, or, knowing them for what they are, remain?”
“They are my folk,” I muttered, thinking her—from the wildness of
her look, the sudden fevered shining of her eyes, the ceaseless
fluttering of her thin hands—distraught from the terrors of the
house; recalling how, day after day, she sat by me at table, uttering
not a word, and addressed by no one; going then from table to be
seen no more, till the next meal was served. She had been no more
to me than a pale grey shadow in the house of shadows.
Nor had I felt in her more interest than to ask Oliver carelessly how
she spent her days; and he had answered, “Hid in her room for the
most, haunting the garden; she’s lifeless, bloodless, the wraith of a
maid.”
“They are my folk,” then, I muttered, staring at her.
“Your folk! Are you as they?” she whispered still. “You think only of
the money the old man has, and care not how ’twas come by. You’ll
smile and fawn on him—that man, that evil old man—as his son
smiles and fawns. Knowing—as you must know—”
“The manner of man he is, and the manner of the men about him?
The danger I’m like to meet? Miss Milne, I’m not afraid. They failed
once; do you know that?”
“I know—yes, I know. They failed once; they’ll not fail again”—
suddenly leaning forward clasping her hands, peering at me with
wild bright eyes, and whispering, “Go! Go now ere it’s too late. Go!
and take me with you from this house—this wicked house!”
I was silent, and stared at her, colouring; thinking her surely mad—
such the wildness and terror of her look; as realising, she seemed to
struggle to control herself; facing me white and quivering, she said
at last more calmly, “Mr. Craike, I hear so many secrets in the
house. I have lived here so many years—so many lonely years, and
am so little accounted, that they do not heed me, or care, if I hear
many things that, if they feared me, I would not hear and know.
Knowing—I do beseech you, do not stay within the house! Oh, let
no thought of loss, if you offend your grandfather, prevail with you!
Go!—ere it is too late!”
I said, standing clumsily before her, no longer meeting her look,
“Miss Milne, you ask me to assist you. I know—surely by now I
know—the house is no house for a maid; I’ll aid you to leave it.
Have you no kin or friends out of the house?”
“No kin, no friends. I have lived in this house since I was a little
child. No friends within the house; none in all the world.”
“I’ve a purse of gold,” I said. “I’ll give it to you. With it you may
make your way to London and seek out Mr. Bradbury. With this
message from me—that he conduct you to my mother, who will
befriend you. Come—here’s the purse. I’ll go with you through the
wood. You may take a coach from the village inn and drive to
London. But I stay here.”
She drew back from me. She whispered, “No! Go now, and take me
with you! How should I find my way to London alone, or seek out
this man Bradbury, or your mother? I have lived nigh all my life in
this house; I am afraid. Go with me!”
“Miss Milne, I must remain,” I said.
“For money?” she said, with scorn; but I answered, “Think that if
you will. For adventure, for a promise.”
“It’s like to end in death,” cried she, and drew back from me.
“Well, then, what have you heard?” I asked.
“Plots! Plots! What use to tell you, if you will not heed me? If I tell
you, will you go from this house? Will you take me out of it?”
“I do not say I’ll go. But I’ll help you, surely!”
She looked at me with her eyes now dark and sullen; bitterly she
said, “I’ve given you warning. I’ll not tell you more. Why should I
tell you aught I know? What do I know of you save that you seem a
boy—a fool—and not yet lost as they. Though coming of their stock
—”
“I do assure you,” I stammered, “I—”
She burst out, “Stay—if you will! Stay! And yet I warn you.” She
slipped from me, and vanished like a wraith into the shadows of the
wood.
Chapter XXV. Insistence of Captain
Blunt

Now attempting to follow Miss Milne, and have further conversation


with her, I found myself presently in a wild tangle of the wood, so
that I had much difficulty in forcing my way through it. Not finding
her, bramble-scratched and moss-stained at last I reached the wall,
and followed it down, thinking to find the breach by which I had left
the garden. But as I approached it, I halted suddenly, hearing
voices from the garden; and, knowing them for the voices of Blunt
and Martin Baynes and my uncle, engaged in an unseemly wrangle,
I rejoiced that I was still hidden by the creepers hanging over the
wall.
Blunt was growling, “Ay, ay, you’ve given me to know you’ll be rich,
when the old man’s gone. You think to lay your hands then on the
spoil he’s piled up and held all these years. Ay, but the old man’s
alive, and I’m sailin’ again with never a penny of profit to me.”
“And the lad’s come to the old man,” Martin broke in, “and by all
saying he’s likely to have every penny, and you not the colour of a
farthing. What d’ye say to that, Mr. Craike? what d’ye say?”
My uncle answered disdainfully, “You get nothing from me. You’re a
pretty pair of rogues to come and threaten. I trust you, Baynes, to
hold the rogue and you to take him aboard, Blunt; and he slips
through your hands. I wonder at your audacity.”
“Fine talk!” cried Blunt; and Martin burst out, “You’ll pay nothing!
Will you not? What if I go to old Sir Gavin? What if I give him the
tale? He’d listen and he’d set you by the heels, as gladly as he’d set
Roger Galt. Though you’re one of his kind—”
“You have it,” my uncle assented, “one of Sir Gavin’s kind. Do you
threaten me, Martin Baynes, you, for all the repute of the Stone
House and Mistress Baynes and her grandsons? Are there not
strange tales of the Stone House—of travellers lost on the moors?
Of a pedlar whose dog was heard wailing at the gates of the Stone
House, as dogs wail for their dead masters? Do you threaten me,
Martin Baynes? And you, Blunt? Did you never sail further than the
coasts of France? Did you never plunder an English ship? Were you
never more than smuggler?”
“Never more,” cried Blunt, “than Edward Craike, and never so much.”
“A gentleman of fortune,” said my uncle, “a voyager born a hundred
years and odd after his time. Tush, that my father profited by his
voyages is nothing, Blunt; he plundered no English ships; if his men
spilt any blood, it was not English.”
“Barwise in his cups—” Blunt began.
“Barwise is just such a besotted fellow,” cried my uncle, “as should
pitch you the tale you’d wish to hear, Blunt. Now ere you two
presume to threaten me, think who’ll believe you? If I sought to
keep John Howe out of the house, and have him shipped overseas—
what of it? What should this count against me save with a few
virtuous fools to whose praise or blame I am indifferent? D’ye think
I’ve no credit with His Majesty’s Ministers? D’ye think that the Town
would ever regard me as other than a man of birth and fashion?
What if there be rumours of my father’s past, or scandal against
me? Your words would avail you nothing. But you, you rogues; the
word from me would hang you both. Tush, when you threaten me,
you’re fools.”
“We want no more than payment,” Blunt growled.
“That I’d not have to give you, if you’d earned it.”
“There’s money in the house,” Blunt urged. “There’s plate. There’s
talk of a great chest of gold and jewels.”
“I would,” said my uncle softly, “I might dip my hands into it.”
“D’ye not know of it?” Blunt asked. “D’ye not know it’s talk among
all the folk of the house that the old man hid the richest stuff he
ever took?”
“I do not know this, Blunt—upon my honour.”
“And I know,” Martin struck in, “that whatsoever the old man has is
like to go to his grandson. And that the old man’s threatened you, if
you so much as lift a finger against the boy, he’ll not spare you. I
have it from old Thrale.”
“Tush,” said my uncle, “I’ve listened too long, my friends. Your
threats do not perturb me. I hold the cards, not you. I know
nothing of such a chest. Pray, go! Well for you to be sailing, Blunt.
Sir Gavin is no fool, and the Wasp lies off the coast too long for your
security. And well for you, Martin Baynes, to be sailing with Blunt;
you’re idle; you’re mischievous; you’d be well away.”
“Ay, and the lad?” Blunt asked. “Would you have him sail with us
yet?”
“I have no preference.”
“Ay, but if you knew he was safe aboard, and sailing with me—not
for France, for pickings in the Indies—would you find me the
hundred guineas then, Mr. Craike, ere I sailed?”
“I should find one hundred guineas with ease,” my uncle answered.
“I suggest nothing, direct nothing—have no share in any plot against
my nephew. Yet if I knew—and none here knew—that he was safely
under hatches, Blunt, I’d pay this hundred guineas ere you sailed.”
“He’ll be out of the house this night, aboard by the morning,” Blunt
vowed.
I heard my uncle’s light laughter; I heard him humming a tune as he
walked away. Blunt and Martin came scrambling over the wall, and
not detecting me hidden under the creepers, tramped away through
the wood.
Chapter XXVI. Sir Gavin Masters

Now for a space I lay hid under the wall, having no mind to enter
the garden and meet my uncle, but seeking time to review the perils
threatening me, and the steps by which I should avoid them. I
believed that Blunt, ere he made his offer to my uncle, had already
planned with the old rogues my removal from the house, and that of
this the girl Evelyn Milne would have warned me. I thought first of
going immediately to my grandfather and of laying the plot before
him; having with me always the thought of the broken figure, of the
will striving ever to prevail over decay, I could perceive little hope
from such a course. Had Miss Milne faced me now; had she
appealed to me to take her out of the house, and escape with her to
my friends, I should have hesitated not at all; my concern for myself
urged me to instant flight; yet I was no such coward as to take to
my heels, and leave her friendless in a house of which she had
expressed such terror. I could devise no better plan than further to
search the wood for her, and if I failed to find her, proceed to seek
out Sir Gavin Masters, tell my tale to him, and urge his intervention
and protection for us, and his immediate communication with Mr.
Bradbury. I marvelled that one so acute as Mr. Bradbury, knowing
the character of the house and its folks, and the peril I must
encounter, should have thought fit to leave me at Rogues’ Haven.
I remained hid under the wall, till Blunt and Martin should be well
away; crawling back then to the wood I sought the girl as best I
might, fearing to call her name, lest I bring my enemies upon me.
Failing, I forced my way out of the old plantation; struggled through
a ditch; climbed through a sunken fence, and muddy and torn with
brambles, sought the road by which Mr. Bradbury had brought me to
Craike House.
It was now toward noon of a clear day; the wood was green about
me; the sunlight and the sense of freedom after the terrors of the
close old house restored my spirits speedily. I had a certain
compunction at my flight—leaving the girl, and, indeed, my
grandfather, old and broken, among the covetous rogues. I told
myself that I should save them better by reaching Sir Gavin Masters,
yet I could not rid my mind of the thought that by running off in fear
of Blunt I played the coward. So much at last this thought
concerned me, that even on the very bank above the road I stood
irresolute. Not yet was I resolved when the sound of hoof-beats
made me cower into the grass, for fear lest any of my enemies
should ride that way. Peering through the covert, I saw a stout red-
coated gentleman mounted on a cob; with joy I recognised Sir Gavin
Masters. He paused below me, sheltering his eyes with his hand
against the sun, he was staring up toward Craike House, whose
chimney stacks alone showed above the wood. As I rose out of the
grass, he uttered an exclamation; his hand sought the pistol in his
holster.
“Sir Gavin,” cried I, “don’t you know me—John Craike?”
“Aha, Master Craike—aha!” He laughed and touched his hat with his
whip. “What are you doing here, lad? Walking abroad?”
“Seeking you, Sir Gavin. Asking your help and advice. Purposing as
soon as I may to seek Mr. Bradbury in London.”
“Oho, not liking the house and the folk in it,” drawing in by the bank,
and beckoning me to him.
Standing beside him, I saw that his face, which I had thought dull as
worthy Mr. Chelton’s, was marked by a certain strength and
intelligence; his eyes watched me shrewdly. He muttered, “So
you’ve had trouble, lad! You want advice from me and Bradbury.
Well then!”
“Mr. Bradbury being now in London—” I began.
“Mr. Bradbury,” he laughed, “is no further away than at my house.
That’s for your ear alone. He’s within your reach whenever you may
have need of him.”
“I’ve need of him at once,” I said, overjoyed.
“Must you have speech with him?” he asked, “or is it a word that I
may carry to him?” I looked at him doubtfully; he went on swiftly,
“Mr. Bradbury made no mention to you of his association with me, I
being newly-appointed justice of the peace for these parts, and bent
on enforcing His Majesty’s laws, and putting an end to a variety of
evil-doings. I’m well-informed of Bradbury’s wishes. It’s his wish
that you remain at Craike House. You’re running away. Why?”
“Having overheard a pretty plot to put me aboard Blunt’s ship and
get me out of England. Fearing—ay, fearing though you think me a
coward, sir, to stay in the house with never a friend.”
“Young Oliver! You’ve been riding abroad with him; you were
swimming in the sea with him this morn. You seemed friends.”
“You saw us, sir?”
“Some of my folk. Oliver’s your friend?”
“Yes, my friend, but—”
“I tell you this, John Craike,” he said, impatiently, “if you’ll believe
me and trust me and my folk, knowing that Bradbury’s within reach,
you’ll go back to the house. I promise you none of the rogues in the
house’ll do you hurt, while old Mr. Edward lives, and I promise you
Blunt’ll never take you out of it or ship you aboard. For Blunt’ll
never sail.” He spoke now in low and earnest tone, his eyes keeping
a sharp watch, as if apprehensive lest any overhear or see us
together. “Hark ’ee,” he said, “go back! It’s well that you stay to
profit by your grandfather’s fancy for you. Take my assurance for it,
lad; my plans and Bradbury’s are surely set; they’re one and the
same. Take my word for it.”
“Ay, but the old man’s near to dying,” I said, doubtfully.
He muttered, “So! Bradbury gave me no word of it.”
Rapidly I recounted the nature of my interviews with my grandfather,
his orders to his servants, his collapse on that first morning, my
belief that his reason tottered,—all the whispering menace of the
rogues about us. I told him of my uncle’s conversation with Blunt
and Martin, and of the warning from Miss Milne.
He heard me attentively, his brows frowning. He said at last, “Ay, ay,
—and for all Bradbury’s plans it’s high time to make an end—high
time! But first I must have a word with Bradbury. Will you go back
this day assured that speedily you’ll hear from us?”
I answered, “If you’ll have it so, Sir Gavin, surely I’ll go.”
He dipped his hand into his holster; drew out a pistol; and handed it
to me swiftly. He took a little bag from his pocket, and muttered,
“The barker’s loaded. Here’s powder and ball. In case you need it,
lad. You go back!”
I answered, “Yes, I’ll go back, and I’ll remain till I hear from Mr.
Bradbury and understand his wishes.”
He said, “I promise you you’ll hear from us at once, lad!”—and as I
plunged up the bank, he turned his cob and rode off rapidly.
Chapter XXVII. Suspicions of Mr.
Charles Craike

It was afternoon when I climbed back through the breach in the wall
and dropped into the garden. I had noted, as I went through the
garden that morning, an arbour overgrown with honeysuckle; in the
sunshine now it was a pavilion of gold and green. I was hurrying by
this arbour when I was startled to hear my uncle’s voice.
“Nephew!” he called; and, turning, I saw him in the arbour, lounging
indolently on an old garden seat of marble, yellow with age and
stains; his arms outstretched along its back; he seemed bloodless,
ivory-white, in the green shade.
“Nephew!” he called again, and beckoned to me. Much as I feared
and hated him I obeyed him. He smiled benignly on me; observing
my colour and the disorder of my dress, he asked, “Why, nephew,
nephew, into what mischief have you been straying? You’re too old
for boyish pranks, and I assume too young for philandering.”
I answered, “I’ve been walking in the wood.”
“The wood!” he repeated. “You’re gaining confidence in us, John. A
week or two since and you’d not have had the courage to stir from
the house. And yet the wood is none too safe, nephew.”
I answered boldly, “I agree with you, sir. For example, I chanced
upon two rogues, Blunt and Martin Baynes.”
Maybe my tones confirmed the suspicions he had formed when I
came scrambling over the wall. He said drily, “You mean more than
your words, John. The encounter should warn you not to walk in
the wood, or yet ride down to the coast with my son. Mayhap,
Oliver is no more than a decoy”—his lips curling.
“I do not think it of my cousin,” I said.
“Oh, I’m happy to have your assurance, John. You look to find a
friend in Oliver. And yet I should not think it, John. My lad’s well
enough, but rough, uncouth; I fear he does me poor credit. How he
passes his days I know not. He’s dissolute; you’ve observed him
with the bottle.”
He broke off, as wearying of the theme; he looked languidly over the
sunlit garden to the ivied walls, “Here’s the very wreck and ruin of a
great house, John!” he sighed. “I have a notion—nay, since your
coming I have it not—of shaping order out of chaos. Here in this
garden, with a book on such a sunlit afternoon; but here, with
delightful arbours, trim walks and plots of flowers,—a fountain
playing silver! Mark that old fountain, John—the form of it, the
seamaids who support the sea-green shells; the fountain’s dry; the
lovely shapes of bronze corroded. Or the designs on this pale
marble: see where the moss grows green in these delicate designs
of Italy. The sun-dial where the sparrows chirp—why, here’s an
enchanted garden, John, where time stands still, as in the old wives’
tale. Ay, see the hedge of thorns grows all about the castle! Time
stands still! Nay, ah nay! I’d picture, John, the garden in the days
when the second Charles was King of England. Why, I have looked
from my window of a summer night, and I have seen the ghosts
walk in the garden, as it was, and I have known the beauty and the
colour and the laughter of this garden and this house, as once they
were. I have thought of the beauty of Craike House restored, the
greatness of our race—ah me! Here am I, penniless son of—Mr.
Edward Craike; penniless parent of—Oliver! I’d tell my hope to you,
John Craike, that, if you win, you yet may care to carry out my own
ambition.”
He had spoken earnestly; while his fine, melancholy voice sounded, I
did believe him,—knowing him for a rogue. His mood did not
endure. He laughed, and eyeing me, he said, “So you’ve
progressed, my friend, in the favour of your grandfather. So you’re a
master in the house, and his retainers take their orders from you as
from himself!”
“He did no more than insure me against insolence,” I answered
uneasily. “You’re well served, my uncle!”
“Oh, I am!” he conceded. “To be sure, the woman Barwise came
raging to me that morning. They’re servile to you, nephew, are they
not? Thinking my father not yet in his dotage! And yet he is so
near to breaking.” His eyes held mine; he said quietly, “Nephew, I’ve
a proposal to you, more than truce—alliance. Liking you!”
“As you’ve surely proved, sir!”
“Yet hear me out,” he said. “You stand in favour with your
grandfather. But you’re no fool; what should you say would happen,
were the old man’s wits to go wandering, or were he to die,
suddenly, as old men die, if they be fortunate? How should you fare
at the hands of all these rogues, John?”
“Or at your hands?” I muttered.
“Or at my hands! I compliment you, nephew, on your wit. Or at the
hands of Blunt, or Barwise? This old man so near to dying or to
dotage, nephew! I put this to you.”
“Why, I’d suffer no more,” said I, “than Mr. Bradbury would speedily
call you to account for.”
“A lonely house,” he muttered, “so near the coast. And none save
old Sir Gavin within miles of us. Should we not work our will with
you, and set our fingers on what’s hid in the house, and be away—in
France, or whither in the world we would—ere Bradbury might lift a
finger.”
“What’s hid in the house!” I repeated.
With sudden impatience he cried out, “Ay, what’s hid in the house!
Why not be frank with me, nephew? You know this—Bradbury
knows, as I—there’s in this house more than a moiety of all my
father ever took on his voyages. There’s treasure in this house,
about this house; and one man knows where it is hidden. And one
man knows, and this one man may die, or his mind grow dark, and
he forget, and it never be known. You know of the existence of this
treasure, nephew, this secret hoard of his—and yet you lie to me!”
Unguardedly I answered, “I’ve heard no more than a talk of the
treasure.”
“When? From whom?” he took me up instantly, and his face was
livid, and his eyes were two evil gems. “This morn! Surely you
heard this morn. Talk near the wall there. Or do you know from
him?”
I said coolly, “I’ll tell you nothing.”
He mastered himself; he lay back on the seat; his lips sneered at
me. “I would have made alliance with you, nephew,” he said. “I
would have shared with you—as kinsman. I would have offered you
security. Ay, I offer it now.”
I answered deliberately, “I’ll have no dealings with you. None!”
“Nephew,” he said, with mock severity, “I abhor duplicity. I confess
myself mistaken in you. Pray go! You stand between me and the
sunshine!”
I swung upon my heel and left him. I heard him humming his little
tune as I climbed the steps.
Chapter XXVIII. Spilt Wine

I passed the remainder of the day in my room with a book. Now I


have since found agreeable entertainment in the works of Mr.
Fielding; but though I had before me The History of Amelia, I
heeded little of aught I read. I had good cause for reflection. That I
was yet in the old house; that all about me were my enemies;
though I had Sir Gavin’s assurance no hurt should befall me, I yet
dreaded that steps would be taken to spirit me away, and Blunt,
having laid hands on me, would elude pursuit. I looked for Mr.
Bradbury’s arrival; Mr. Bradbury did not come.
None came nigh me; my grandfather did not summon me to his
presence. The day closed clouded; the darkness of the sky and the
rising wind promised storm to follow on the sunshine of the day. At
dusk, Thrale came with lighted candles; but for the warmth of the
evening I bade him leave the fire unlit. I made my toilet hurriedly
for dinner at the clangour of the bell through the house; secreting
the loaded pistol in my tail-pocket, and praying God that I should not
sit upon it forgetful, I went down into the dining-hall. My
grandfather, leaning upon his son, entered ahead of me; he gave me
no word or nod in greeting. I stood apart with Oliver, and Evelyn
Milne, who did not glance at me or speak to me; Oliver seemed to
have returned half-drunken from the alehouse in the village, whither
he had ridden that day.
Regarding my grandfather, as his son assisted him to his chair, I saw
with apprehension that his face was livid; his eyes were dull and
heavy; the rubies blazed upon his shaking hands. And from the
gloom behind his chair the old rogues watched him. I heard them
mutter and whisper among themselves; I knew that the sickness so
plainly on my grandfather could not be lost even to their dull eyes
and wits. The girl was whispering by me, “He’s sick! To death! Had
you but listened to me!”
I paid her no heed. I set myself to my meal; seeking by exercise of
will to hide my perturbation from my uncle, whom I saw watching
me with eyes triumphant and malignant. The old man sat staring
before him. The tapers waved in the draughts of cold air. I know
not what my grandfather saw in that pale light or in those shadows
seeming to dance a wild dance all about us, as the ever-rising wind
beat on the house, and found its way into the room by chink and
broken pane. I had a prescience that death was in the wind that
night; that the dead from the deep called him at last to be of their
company for ever.
My uncle essayed gay conversation; the old man sat beside him like
the very figure of death; he uttered not a word; he would have lifted
a glass to his lips, and the spilt red wine dyed his mouth and hands.
As the glass broke upon the board, my uncle, with assumed concern,
said in a loud, clear voice, as if to be assured it reached the ears of
all the rogues, standing peering from the shadows like so many
carrion crows. “You’re sick, sir! Shall I aid you to your room?”
He cried out angrily, “I’m well! I’m well! Another glass!”
Thrale, filling a glass, handed it to him; I understood from the
working of the old man’s face and by the sweat upon his brow the
bitter struggle of the breaking will to assert itself. My grandfather
lifted the wine to his lips, and sipped a little of it. He sought then to
eat, but ate nothing; he sat stiffly in his chair, until the girl had gone
like a pale ghost from the room; and the cloth was drawn. She cast
a look at me, as I rose at her departure; and there was terror in her
eyes,—as there was terror in my mind. For the ending struggle of
the old man’s will and body, for the clamour of the winds about the
house, for all the faces peering malevolently from the dark, for the
ghostly dance of lights and shadows; always the cold draughts
struck in and set the candles flickering.
My uncle, filling his glass, invited me to take wine with him; Oliver
was drinking heavily. “A glass of wine, nephew!” cried my uncle,
gaily. “A glass of wine with me.”
My grandfather muttered suddenly, “Do you make a play for me,
Charles?”
“Make a play, sir!” Charles repeated. “Forgive me. I am dull. I do
not understand you.”
“Ay,—do you pretend friendship—affection, for—for your brother’s
son, or your brother, sitting over there?”
My uncle, looking at me, cried out in amaze, “My brother, sir! My
nephew, surely!”
“Nay! Nay!” the old man insisted, testily. “Your brother!”
“The lad, sir?” Charles faltered.
“The lad! Damn the lad! Are you blind, Charles? Are you blind?
Your brother sitting there!” His shaking hand stole out; he pointed
not at me, but at the empty chair beside me, “Your brother—
Richard!”
And now my uncle’s triumphant look had fled. Now staring fearfully,
now in turn shaking, he whispered, “Sir, you’re sick! No one sits
there. Pray let me aid you from the table,” and rose and offered his
hand.
The old man thrust it from him, and pointed still. “Sick! Are you
drunk, Charles, that you do not see? Richard!”
“Sitting there!”
“Ay, sitting there! Would you have me think him a ghost, Charles?
Would you have me think him dead?”
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like