Sha256: d83f41708c6e15ea7c4b8478f2d14b2602319e0c2175e42504851a9d0b7e3eee

Contents?: true

Size: 1.09 KB

Versions: 15

Compression:

Stored size: 1.09 KB

Contents

module Fitting
  module Report
    class Test
      def initialize(test)
        @test = test
        @prefix = false
        @action = false
        @response = false
        @combination = false
        @id = SecureRandom.hex
      end

      attr_reader :id

      def to_h
        {
          path: path,
          method: method,
          status: status,
          body: body
        }
      end

      def path
        @test['path']
      end

      def method
        @test['method']
      end

      def status
        @test['response']['status'].to_s
      end

      def body
        @test['response']['body']
      end

      def mark_prefix
        @prefix = true
      end

      def mark_action
        @action = true
      end

      def mark_response
        @response = true
      end

      def mark_combination
        @combination = true
      end

      def there_a_prefix?
        @prefix
      end

      def there_an_actions?
        @action
      end

      def there_an_responses?
        @response
      end

      def there_an_combinations?
        @combination
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
fitting-4.2.1 lib/fitting/report/test.rb
fitting-4.2.0 lib/fitting/report/test.rb
fitting-4.1.0 lib/fitting/report/test.rb
fitting-4.0.4 lib/fitting/report/test.rb
fitting-4.0.3 lib/fitting/report/test.rb
fitting-4.0.2 lib/fitting/report/test.rb
fitting-4.0.1 lib/fitting/report/test.rb
fitting-4.0.0 lib/fitting/report/test.rb
fitting-3.0.2 lib/fitting/report/test.rb
fitting-3.0.1 lib/fitting/report/test.rb
fitting-3.0.0 lib/fitting/report/test.rb
fitting-2.18.3 lib/fitting/report/test.rb
fitting-2.18.2 lib/fitting/report/test.rb
fitting-2.18.1 lib/fitting/report/test.rb
fitting-2.18.0 lib/fitting/report/test.rb