Книга RSpec: разработка, основанная на функционировании с RSpec, Cucumber, и друзьями. Глава 12. Образцы кода

David Chelimsky, Dave Astels, Zach Dennis, Aslak Hellesøy, Bryan Helmkamp, Dan North, “The RSpec Book: Behaviour Driven Development with RSpec, Cucumber, and Friends. Chapter 12. Code Examples”, public translation into Russian from English More about this translation.

See also 26 similar translations

Translate into another language.

Participants

Yahonto926 points
weblomaster261 points
GremL1N4 points
Join Translated.by to translate! If you already have a Translated.by account, please sign in.
If you do not want to register an account, you can sign in with OpenID.
Pages: ← previous Ctrl next next untranslated
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

The RSpec Book: Behaviour Driven Development with RSpec, Cucumber, and Friends. Chapter 12. Code Examples

Книга RSpec: разработка, основанная на функционировании с RSpec, Cucumber, и друзьями. Глава 12. Образцы кода

History of edits (Latest: Yahonto 1 year, 9 months ago) §

Chapter 12

Глава 12

History of edits (Latest: Yahonto 1 year, 9 months ago) §

Code Examples

Образцы кода

History of edits (Latest: GremL1N 1 year, 8 months ago) §

— по смыслу "образцы" и "примеры" очень близки, но после длительного чтения я стал склоняться больше к термину "образцы" Yahonto

— согласен. дальше по чтению тож пришел к такому варианту. GremL1N

In this part of the book, we’ll explore the details of RSpec’s built-in expectations, mock objects framework, command line tools, IDE integration, and extension points.

В этой части книги мы будем изучать детали встроенных в RSpec ожиданий, контрольных структур объектов, инструментов командной строки, интегрирования IDE (IDE integration) и точек расширения (extension points).

History of edits (Latest: Yahonto 1 year, 9 months ago) §

— mock objects framework - фальшивые объекты фреймворка? GremL1N

— не знаю как правильно, но скорее тогда "фреймворк мнимых объектов". дальше по тексту будет понятно о чем речь. Yahonto

Our goal is to make Test Driven Development a more joyful and productive experience with tools that elevate the design and documentation aspects of TDD to first class citizenship. Here are some words you’ll need to know as we reach for that goal:

Наша цель состоит в том, чтобы сделать разработку через тестирование (Test Driven Development) более радостной и производительной практикой с инструментами, которые улучшают некоторые аспекты проэктирования и документирования TDD до первоклассного уровня. Вот некоторые слова, которые Вы должны будете знать, чтобы мы достигли этой цели:

History of edits (Latest: Yahonto 1 year, 9 months ago) §

subject code The code whose behaviour we are specifying with RSpec.

Предметный код (subject code) - код, поведение которого мы определяем с помощью RSpec

History of edits (Latest: Yahonto 1 year, 9 months ago) §

expectation An expression of how the subject code is expected to behave. You’ll read about state based expectations in Chapter 13, RSpec::Expectations, on page 172, and interaction expectations in Chapter 14, RSpec::Mocks, on page 193.

Ожидание (expectation) - выражение того, какое ожидается поведение предметного кода. Вы прочитаете об ожиданиях основанных на состоянии в главе 13, об RSpec::Expectations на стр. 172, а также о взаимодействии ожиданий в главе 14, RSpec::Mocks на странице 193.

History of edits (Latest: Yahonto 1 year, 9 months ago) §

code example An executable example of how the subject code can be used, and its expected behaviour (expressed with expectations) in a given context. In BDD, we write the code examples before the subject code they document.

Образец кода (code example) - исполняемый образец того, как предметный код может быть использован, и его ожидаемое поведение (представленное с помощью ожиданий) в данном контексте. В BDD мы пишем образец кода перед предметным кодом, который они документируют.

History of edits (Latest: Yahonto 1 year, 9 months ago) §

The example terminology comes from Brian Marick, whose website is even named http://exampler.com. Using “example” instead of “test” reminds us that writing them is a design and documentation practice, even though once they are written and the code is developed against them they become regression tests.

Терминология "образец" предложена Брайаном Мариком, чей сайт даже назвали http://exampler.com. Использование термина "образец" вместо "тест" напоминает нам о том, что их написание является практикой проектирования и документирования, хотя, когда они написаны и код разработан вопреки им, то они становятся регрессивными тестами.

History of edits (Latest: Yahonto 1 year, 9 months ago) §

example group A group of code examples.

Комплект образцов (example qroup) - комплект образцов кода.

History of edits (Latest: Yahonto 1 year, 9 months ago) §

spec, a.k.a. spec file A file that contains one or more example groups.

Спецификация (spec), известный также как файл спецификации (spec file) - файл, который содержит один или более комплектов образцов.

History of edits (Latest: Yahonto 1 year, 9 months ago) §

Familiar structure, new nomenclature

Привычная структура, новая терминология

History of edits (Latest: Yahonto 1 year, 9 months ago) §

If you already have some experience with Test::Unit or similar tools in other languages and/or TDD, the words we’re using here map directly to words you’re already familiar with:

Если у вас уже есть некоторый опыт работы с Test::Unit или аналогичными инструментами в других языках программирования и/или TDD, то слова, которые мы используем здесь полностью соответствуют словам, с которыми Вы уже знакомы:

History of edits (Latest: Yahonto 1 year, 9 months ago) §

• Assertion becomes Expectation.

• Утверждение (Assertion) становится Ожидание (Expectation).

History of edits (Latest: Yahonto 1 year, 9 months ago) §

• Test Method becomes Code Example.

• Метод тестирования (Test Method) становится Образец кода (Code Example).

History of edits (Latest: Yahonto 1 year, 9 months ago) §

• Test Case becomes Example Group.

• Набор тестовых данных (Test Case) становится Комплект образцов (Example Group).

History of edits (Latest: Yahonto 1 year, 9 months ago) §

In addition to finding these new names used throughout this book, you’ll find them in RSpec’s code base as well.

В дополнение к обнаружению этих новых терминов в этой книге, Вы также найдете их в коде RSpec.

History of edits (Latest: Yahonto 1 year, 9 months ago) §

In this chapter you’ll learn how to organize executable code examples in example groups in a number of different ways, run arbitrary bits of code before and after each example, and even share examples across groups.

В этой главе вы узнаете, как организовать исполняемые образцы кода в комплекты образцов разными способами, выполнить произвольные биты кода до и после каждого образца, и даже совместное использование образцов из разных комплектах.

History of edits (Latest: Yahonto 1 year, 9 months ago) §
Pages: ← previous Ctrl next next untranslated
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15