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.
29 30 31 |
# File 'lib/bridgetown/test.rb', line 29 def document @document end |
Instance Method Details
#app ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/bridgetown/test.rb', line 35 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
48 |
# File 'lib/bridgetown/test.rb', line 48 def html(request) = @document = Nokolexbor::Document.parse(request.body) |
#json(request) ⇒ Object
50 |
# File 'lib/bridgetown/test.rb', line 50 def json(request) = @document = JSON.parse(request.body) |
#roda_app_class ⇒ Object
31 |
# File 'lib/bridgetown/test.rb', line 31 def roda_app_class = RodaApp |
#roda_log_level ⇒ Object
33 |
# File 'lib/bridgetown/test.rb', line 33 def roda_log_level = Logger::WARN |
#routes ⇒ Object
52 53 54 55 |
# File 'lib/bridgetown/test.rb', line 52 def routes = JSON.parse(File.read( File.join(Bridgetown::Current.preloaded_configuration.root_dir, ".routes.json") )) |
#site ⇒ Object
44 45 46 |
# File 'lib/bridgetown/test.rb', line 44 def site roda_app_class.opts[:bridgetown_site] end |