Skip to content

Commit

Permalink
#5 test works
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed May 12, 2024
1 parent b5a5c29 commit 1deb81a
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ AllCops:
SuggestExtensions: false
NewCops: enable

Style/GlobalVars:
Enabled: false
Metrics/MethodLength:
Enabled: false
Gemspec/RequiredRubyVersion:
Expand Down
16 changes: 5 additions & 11 deletions lib/judges/pack.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Copyright (c) 2014-2024 Yegor Bugayenko
Expand Down Expand Up @@ -36,10 +35,12 @@ def initialize(dir)
end

# Run it with the given Factbase and environment variables.
def run(fb, env)
$fb = fb
def run(fbase, env)
$fb = fbase
env.each do |k, v|
eval("$#{k} = '#{v}'")
# rubocop:disable Security/Eval
eval("$#{k} = '#{v}'", binding, __FILE__, __LINE__) # $foo = 42
# rubocop:enable Security/Eval
end
s = File.join(@dir, script)
raise "Can't load '#{s}'" unless File.exist?(s)
Expand All @@ -57,11 +58,4 @@ def tests
YAML.load_file(f)
end
end

# Iterate over .yml tests.
def tests
Dir.glob(File.join(@dir, '*.yml')).map do |f|
YAML.load_file(f)
end
end
end
1 change: 0 additions & 1 deletion lib/judges/packs.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Copyright (c) 2014-2024 Yegor Bugayenko
Expand Down
1 change: 0 additions & 1 deletion lib/judges/test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Copyright (c) 2014-2024 Yegor Bugayenko
Expand Down
1 change: 0 additions & 1 deletion lib/judges/update.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Copyright (c) 2014-2024 Yegor Bugayenko
Expand Down
1 change: 0 additions & 1 deletion test/test_judges.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2024 Yegor Bugayenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
1 change: 0 additions & 1 deletion test/test_pack.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2024 Yegor Bugayenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
1 change: 0 additions & 1 deletion test/test_packs.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2024 Yegor Bugayenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
1 change: 0 additions & 1 deletion test/test_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2024 Yegor Bugayenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
1 change: 0 additions & 1 deletion test/test_update.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

#
# Copyright (c) 2024 Yegor Bugayenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down

0 comments on commit 1deb81a

Please sign in to comment.