testsuite 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6df05e178cf7b5d99ba4726e1cd59752634dae5dc63673b8da533c93bb9a599f
4
+ data.tar.gz: 936e1c0806df5623cc03b7bb2fb10586c7a6cc23f55c9d0d3fcf72067da7551a
5
+ SHA512:
6
+ metadata.gz: 310c030c1a46f945dbde7ac8bdbb995ec17e223a269de9c9bd436b32840bc24b30c5ebec9b5952ef4c484fbab291f6438753725bc1d84748807012e0c51100f1
7
+ data.tar.gz: fcda390f61045fa9ed42baeb124e9f6f481414b48333ba593e0b9a733f7d12c013ab1a281b7b8ee216bc288528f8013e60618468348ff1a854e76263ae67fd88
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /.idea/
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+ ruby '2.5.1'
3
+
4
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
5
+
6
+ # Specify your gem's dependencies in testsuite.gemspec
7
+ gemspec
@@ -0,0 +1,20 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ testsuite (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.5.0)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ bundler (~> 1.16)
16
+ rake (~> 10.0)
17
+ testsuite!
18
+
19
+ BUNDLED WITH
20
+ 1.16.2
@@ -0,0 +1,41 @@
1
+ # Testsuit
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/testsuit`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'testsuite'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install testsuit
20
+
21
+ ## Usage
22
+
23
+ Edit test-config file or create custom and use
24
+
25
+ ## Development
26
+
27
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
+
29
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/testsuit. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
34
+
35
+ ## License
36
+
37
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
38
+
39
+ ## Code of Conduct
40
+
41
+ Everyone interacting in the Testsuit project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/testsuit/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "testsuite"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,25 @@
1
+ # edit this file to config your tests
2
+ load '' # put here file with class for testing
3
+ # math_exercises = .new # put here class for testing
4
+
5
+ TASKS = [] # array with numbers of tasks
6
+
7
+ EXPECTED = {} # hash with expected results
8
+
9
+ ACTUAL = {} # hash with actual results
10
+
11
+ "
12
+ Example of edited file
13
+ load 'main.rb'
14
+ math_exercises = MathExercises.new
15
+
16
+ TASKS = [1, 2, 3, 4, 5, 6, 8, 9, 10]
17
+
18
+ EXPECTED = { 1 => [5, -1, 6],
19
+ 2 => 1,
20
+ 3 => [8, 16]}
21
+
22
+ ACTUAL = { 1 => math_exercises.task1(a: 2, b: 3),
23
+ 2 => math_exercises.task2(x: 2, y: -1),
24
+ 3 => math_exercises.task3(a: 2)}
25
+ "
@@ -0,0 +1,25 @@
1
+ require "testsuit/version"
2
+
3
+ module Testsuit
4
+ class Tester
5
+ def assert(expected:, actual:)
6
+ if expected == actual
7
+ 'PASSED'
8
+ else
9
+ 'FAILED'
10
+ end
11
+ end
12
+
13
+ def test_core
14
+ TASKS.each do |task|
15
+ puts "test task#{task} is #{assert(expected: EXPECTED[task], actual: ACTUAL[task])}"
16
+ end
17
+ end
18
+ end
19
+
20
+ puts 'Input config file or press enter to use default file'
21
+ conf = String(gets.chomp)
22
+ conf != '' ? (load conf) : (load 'test-config.rb')
23
+ run = Tester.new
24
+ run.test_core
25
+ end
@@ -0,0 +1,3 @@
1
+ module Testsuit
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,36 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "testsuite/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "testsuite"
8
+ spec.version = Testsuit::VERSION
9
+ spec.authors = ["AlexProtsiuk"]
10
+ spec.email = ["alex_is_ok@yahoo.com"]
11
+
12
+ spec.summary = %q{gem is created for testing some solutions of math-tasks}
13
+ spec.homepage = "https://github.com/OleksandrProtsiuk/testsuite-gem.git"
14
+ spec.license = "MIT"
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ # if spec.respond_to?(:metadata)
19
+ # spec.metadata["allowed_push_host"] =
20
+ # else
21
+ # raise "RubyGems 2.0 or newer is required to protect against " \
22
+ # "public gem pushes."
23
+ # end
24
+
25
+ # Specify which files should be added to the gem when it is released.
26
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
27
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
28
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
29
+ end
30
+ spec.bindir = "exe"
31
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
+ spec.require_paths = ["lib"]
33
+
34
+ spec.add_development_dependency "bundler", "~> 1.16"
35
+ spec.add_development_dependency "rake", "~> 10.0"
36
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: testsuite
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - AlexProtsiuk
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-11-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description:
42
+ email:
43
+ - alex_is_ok@yahoo.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - Gemfile.lock
51
+ - README.md
52
+ - Rakefile
53
+ - bin/console
54
+ - bin/setup
55
+ - lib/test-config.rb
56
+ - lib/testsuite.rb
57
+ - lib/testsuite/version.rb
58
+ - testsuite.gemspec
59
+ homepage: https://github.com/OleksandrProtsiuk/testsuite-gem.git
60
+ licenses:
61
+ - MIT
62
+ metadata: {}
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.7.7
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: gem is created for testing some solutions of math-tasks
83
+ test_files: []