# Path: cli_bdd/core/steps/base.py
# class StepBase(object):
#     type_ = None  # given, when, then
#     sentence = None
#     func_name = None
# 
#     def build_step_func(self):
#         raise NotImplementedError()
# 
#     def get_table(self):
#         raise NotImplementedError()
# 
#     def get_text(self):
#         raise NotImplementedError()
# 
#     def get_scenario_context(self):
#         raise NotImplementedError()


import difflib
import StringIO
import pexpect
from hamcrest import (
    assert_that,
    contains_string,
    equal_to,
    greater_than,
    greater_than_or_equal_to,
    is_,
    is_not,
    less_than,
    less_than_or_equal_to
)
from cli_bdd.core.steps.base import StepBase
        if data.endswith('\n'):
            data_lines.append('')

        expected = self.get_text().encode('utf-8')  # todo: test encode
        expected_lines = expected.splitlines()
        if expected.endswith('\n'):
            expected_lines.append('')

        bool_matcher = is_not if should_not else is_
        comparison_matcher = equal_to if exactly else contains_string
        try:
            assert_that(
                data,
                bool_matcher(
                    comparison_matcher(expected)
                )
            )
        except AssertionError:
            if comparison_matcher == equal_to and bool_matcher == is_:
                diff = '\n'.join(
                    difflib.context_diff(
                        data_lines,
                        expected_lines
                    )
                )
                raise AssertionError('Comparison error. Diff:\n' + diff)
            else:
                raise



# Path: cli_bdd/core/steps/base.py
# class StepBase(object):
#     type_ = None  # given, when, then
#     sentence = None
#     func_name = None
# 
#     def build_step_func(self):
#         raise NotImplementedError()
# 
#     def get_table(self):
#         raise NotImplementedError()
# 
#     def get_text(self):
#         raise NotImplementedError()
# 
#     def get_scenario_context(self):
#         raise NotImplementedError()


# Path: cli_bdd/core/steps/command.py
import difflib
import StringIO
import pexpect
from hamcrest import (
    assert_that,
    contains_string,
    equal_to,
    greater_than,
    greater_than_or_equal_to,
    is_,
    is_not,
    less_than,
    less_than_or_equal_to
)
from cli_bdd.core.steps.base import StepBase

        if data.endswith('\n'):
            data_lines.append('')

        expected = self.get_text().encode('utf-8')  # todo: test encode
        expected_lines = expected.splitlines()
        if expected.endswith('\n'):
            expected_lines.append('')

        bool_matcher = is_not if should_not else is_
        comparison_matcher = equal_to if exactly else contains_string
        try:
            assert_that(
                data,
                bool_matcher(
                    comparison_matcher(expected)
                )
            )
        except AssertionError:
            if comparison_matcher == equal_to and bool_matcher == is_:
                diff = '\n'.join(
                    difflib.context_diff(
                        data_lines,
                        expected_lines
                    )
                )
                raise AssertionError('Comparison error. Diff:\n' + diff)
            else:
                raise



class OutputShouldContainLines(StepBase):