Open8

BDD(振る舞い型駆動開発)をpythonでやるためのbehaveを動かしてみる

k8shirok8shiro
k8shirok8shiro

build

docker build -t behave-python-try .

run

docker run --rm --name behave-python-try -v $(pwd)/src:/src behave-python-try behave
k8shirok8shiro
# docker run --rm --name behave-python-try -v $(pwd)/src:/src behave-python-try behave
Feature: showing off behave # features/tutorial.feature:1

  Scenario: run a simple test        # features/tutorial.feature:3
    Given we have behave installed   # features/steps/tutorial.py:3
    When we implement a test         # features/steps/tutorial.py:7
    Then behave will test it for us! # features/steps/tutorial.py:11

1 feature passed, 0 failed, 0 skipped
1 scenario passed, 0 failed, 0 skipped
3 steps passed, 0 failed, 0 skipped, 0 undefined
Took 0m0.000s

うごいた

k8shirok8shiro

日本語でも動くか試してみた。

tutorial_jp.featureとtutorial_jp.pyを作って動くことを確認