Sha256: 16aed07507912c842c6bec9ee1f3ef27e520773ad6254159fa0d131c0bf2e38f

Contents?: true

Size: 766 Bytes

Versions: 3

Compression:

Stored size: 766 Bytes

Contents

Feature: Be testable in a single Ruby source

  In order to try Observed to see the basic usage usage of it,
  I want to configure and run Observed in just a single Ruby source file

  Scenario: Create a .rb file containing Observed code and run it with the ruby command
    Given a file named "test.rb" with:
    """
    require 'observed'

    include Observed

    class Test < Observed::Observer
      plugin_name 'test'
      def observe
        system.report(tag, {foo:1})
      end
    end

    observe 'foo', via: 'test'

    run 'foo'

    report /foo/, via: 'stdout'

    run 'foo'
    """
    When I run `ruby test.rb`
    Then the output should contain:
    """
    foo {:foo=>1}
    """
    Then the output should not contain:
    """
    Error
    """

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
observed-0.2.0 features/test_in_single_ruby_source.feature
observed-0.2.0.rc2 features/test_in_single_ruby_source.feature
observed-0.2.0.rc1 features/test_in_single_ruby_source.feature