Class: Webspicy::Web::Specification::TestCase

Inherits:
Specification::TestCase show all
Defined in:
lib/webspicy/web/specification/test_case.rb

Instance Attribute Summary

Attributes inherited from Specification::TestCase

#counterexample, #service

Instance Method Summary collapse

Methods inherited from Specification::TestCase

#assert, #bind, #counterexample?, #description, #example?, #expected, #expected_error, #has_assertions?, #has_expected_error?, info, #initialize, #metadata, #mutate, #seeds, #specification, #tags, #to_s

Methods included from Support::DataObject

#initialize, #method_missing, #to_info

Constructor Details

This class inherits a constructor from Webspicy::Specification::TestCase

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Webspicy::Support::DataObject

Instance Method Details

#bodyObject



19
20
21
# File 'lib/webspicy/web/specification/test_case.rb', line 19

def body
  @raw[:body]
end

#dress_paramsObject Also known as: dress_params?



10
11
12
# File 'lib/webspicy/web/specification/test_case.rb', line 10

def dress_params
  @raw.fetch(:dress_params){ true }
end

#expected_content_typeObject



31
32
33
# File 'lib/webspicy/web/specification/test_case.rb', line 31

def expected_content_type
  expected[:content_type]
end

#expected_headersObject



47
48
49
# File 'lib/webspicy/web/specification/test_case.rb', line 47

def expected_headers
  expected[:headers] || {}
end

#expected_statusObject



35
36
37
# File 'lib/webspicy/web/specification/test_case.rb', line 35

def expected_status
  expected[:status]
end

#file_uploadObject



23
24
25
# File 'lib/webspicy/web/specification/test_case.rb', line 23

def file_upload
  @raw[:file_upload]
end

#has_expected_headers?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/webspicy/web/specification/test_case.rb', line 51

def has_expected_headers?
  !expected_headers.empty?
end

#has_expected_status?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/webspicy/web/specification/test_case.rb', line 43

def has_expected_status?
  not expected[:status].nil?
end

#headersObject



6
7
8
# File 'lib/webspicy/web/specification/test_case.rb', line 6

def headers
  @raw[:headers] ||= {}
end

#is_expected_status?(status) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/webspicy/web/specification/test_case.rb', line 39

def is_expected_status?(status)
  expected_status === status
end

#located_file_uploadObject



27
28
29
# File 'lib/webspicy/web/specification/test_case.rb', line 27

def located_file_upload
  file_upload ? file_upload.locate(specification) : nil
end

#paramsObject



15
16
17
# File 'lib/webspicy/web/specification/test_case.rb', line 15

def params
  @raw[:params] || {}
end