Skip to content

Commit

Permalink
#111 basics
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Aug 17, 2024
1 parent 9ee704b commit 6050452
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 4 deletions.
8 changes: 6 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ source 'http://rubygems.org'

gem 'fbe', '>0'
gem 'judges', '>0'
gem 'rake', '13.2.1'
gem 'minitest', '5.25.1', require: false
gem 'minitest-reporters', '1.7.1', require: false
gem 'rake', '13.2.1', require: false
gem 'redcarpet', '~>3.5'
gem 'rubocop', '1.65.1'
gem 'rubocop', '1.65.1', require: false
gem 'w3c_validators', '1.3.7', require: false
gem 'webmock', '3.23.1', require: false
27 changes: 25 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ GEM
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ansi (1.5.0)
ast (2.4.2)
backtrace (0.4.0)
base64 (0.2.0)
Expand All @@ -29,8 +30,12 @@ GEM
tago (~> 0)
typhoeus (~> 1.3)
bigdecimal (3.1.8)
builder (3.3.0)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crack (1.0.0)
bigdecimal
rexml
decoor (0.0.1)
drb (2.2.1)
ethon (0.16.0)
Expand Down Expand Up @@ -88,6 +93,7 @@ GEM
graphql-client (0.23.0)
activesupport (>= 3.0)
graphql (>= 1.13.0)
hashdiff (1.1.1)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
iri (0.8.0)
Expand All @@ -109,7 +115,12 @@ GEM
language_server-protocol (3.17.0.3)
logger (1.6.0)
loog (0.6.0)
minitest (5.25.0)
minitest (5.25.1)
minitest-reporters (1.7.1)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
moments (0.3.0)
multipart-post (2.4.1)
net-http (0.4.1)
Expand All @@ -131,7 +142,7 @@ GEM
faraday (>= 1, < 3)
sawyer (~> 0.9)
others (0.0.3)
parallel (1.26.2)
parallel (1.26.3)
parser (3.3.4.2)
ast (~> 2.4.1)
racc
Expand Down Expand Up @@ -173,6 +184,14 @@ GEM
verbose (0.0.2)
loog (~> 0.2)
tago (~> 0.0)
w3c_validators (1.3.7)
json (>= 1.8)
nokogiri (~> 1.6)
rexml (~> 3.2)
webmock (3.23.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
yaml (0.3.0)

PLATFORMS
Expand All @@ -194,9 +213,13 @@ PLATFORMS
DEPENDENCIES
fbe (> 0)
judges (> 0)
minitest (= 5.25.1)
minitest-reporters (= 1.7.1)
rake (= 13.2.1)
redcarpet (~> 3.5)
rubocop (= 1.65.1)
w3c_validators (= 1.3.7)
webmock (= 3.23.1)

BUNDLED WITH
2.5.16
39 changes: 39 additions & 0 deletions test/pages/test_vitals.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# frozen_string_literal: true

# MIT License
#
# Copyright (c) 2024 Zerocracy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

require 'minitest/autorun'
require 'webmock/minitest'
require 'nokogiri'
require 'w3c_validators'

# Test.
# Author:: Yegor Bugayenko (yegor256@gmail.com)
# Copyright:: Copyright (c) 2024 Yegor Bugayenko
# License:: MIT
class TestVitals < Minitest::Test
def test_validate_html
WebMock.enable_net_connect!
puts 1
end
end
52 changes: 52 additions & 0 deletions test/test__helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# frozen_string_literal: true

# MIT License
#
# Copyright (c) 2024 Zerocracy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

ENV['RACK_ENV'] = 'test'

require 'simplecov'
SimpleCov.start

require 'simplecov-cobertura'
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter

require 'minitest/reporters'
Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new]

require 'minitest/autorun'

class Minitest::Test
def load_it(judge, fb)
$fb = fb
$global = {}
$local = {}
$judge = judge
$options = Judges::Options.new({ 'repositories' => 'foo/foo' })
$loog = Loog::NULL
load(File.join(__dir__, "../judges/#{judge}/#{judge}.rb"))
end

def stub_github(url, body:, method: :get, status: 200, headers: { 'content-type': 'application/json' })
stub_request(method, url).to_return(status:, body: body.to_json, headers:)
end
end

0 comments on commit 6050452

Please sign in to comment.