Class: Bridgetown::Test
- Inherits:
-
Minitest::Test
- Object
- Minitest::Test
- Bridgetown::Test
- Extended by:
- Minitest::Spec::DSL
- Includes:
- Rack::Test::Methods
- Defined in:
- lib/bridgetown/test.rb
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
Instance Method Summary collapse
- #app ⇒ Object
- #html(request) ⇒ Object
- #json(request) ⇒ Object
- #roda_app_class ⇒ Object
- #roda_log_level ⇒ Object
- #routes ⇒ Object
- #site ⇒ Object
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
40 41 42 |
# File 'lib/bridgetown/test.rb', line 40 def document @document end |
Instance Method Details
#app ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/bridgetown/test.rb', line 46 def app return @app if @app # Set the log level to warn so we don't see all the usual HTTP chatter when testing roda_app_class.opts[:common_logger].level = roda_log_level @app = roda_app_class.app end |
#html(request) ⇒ Object
59 |
# File 'lib/bridgetown/test.rb', line 59 def html(request) = @document = Nokolexbor::Document.parse(request.body) |
#json(request) ⇒ Object
61 |
# File 'lib/bridgetown/test.rb', line 61 def json(request) = @document = JSON.parse(request.body) |
#roda_app_class ⇒ Object
42 |
# File 'lib/bridgetown/test.rb', line 42 def roda_app_class = RodaApp |
#roda_log_level ⇒ Object
44 |
# File 'lib/bridgetown/test.rb', line 44 def roda_log_level = Logger::WARN |
#routes ⇒ Object
63 64 65 66 |
# File 'lib/bridgetown/test.rb', line 63 def routes = JSON.parse(File.read( File.join(Bridgetown::Current.preloaded_configuration.root_dir, ".routes.json") )) |
#site ⇒ Object
55 56 57 |
# File 'lib/bridgetown/test.rb', line 55 def site roda_app_class.opts[:bridgetown_site] end |