mimoco 0.3.0 → 0.3.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46ad2c23a3e296f3eef76808c4637c58bbe86331adc4b2ab3ee43d71355065ae
4
- data.tar.gz: 79623b87cb340614552ad62ae3518475aadbb74a9920f916da84dc51f03819d6
3
+ metadata.gz: f7687d9d8c3b8c3971572508cc9185fc7269694a8b5e4f1323276cb2a92e2f23
4
+ data.tar.gz: f03125f88696b0e2047e367944e311c96a62074eebb267f2480909bb635f35d8
5
5
  SHA512:
6
- metadata.gz: 198befd7ec6df74f17e6c7f180df8e726db56552b69207d0b83306e88ce4e90719c00a0b4d06994ca6884da897cf57efbdd3471cabb3221f4e3994a05cbc74d7
7
- data.tar.gz: 4b9290d366fbb089f86b7ae6ec1a336cca97a7e0f6feabead71870363f545338800976349ff4e7d4954fa556bc83df571fd3434b0cd9519084b1f65a67bcfbd3
6
+ metadata.gz: f209deac9fc564873191ff1eec4a481911ac199308e8a3c34bb7c4f6b5e309075238b30bf577113b4f4a61da8854bb95dd3735f11af67b4b115fa9775c819a4f
7
+ data.tar.gz: 3963910ec299d1f399a1a5edc31c55d42d4a01d9d0856d248311ca68c706f8ed601229bfcaff939ca276ea57d7598c9ec1c9da78ab71cd690e224ad4d238c1ce
@@ -1,7 +1,6 @@
1
1
  # see also https://github.com/whitequark/parser/blob/master/.github/workflows/test.yml
2
2
  name: Rake
3
3
 
4
- #on: [push, pull_request]
5
4
  on: [push]
6
5
 
7
6
  jobs:
@@ -9,16 +8,13 @@ jobs:
9
8
  strategy:
10
9
  fail-fast: false
11
10
  matrix:
12
- # os: [ubuntu-latest, macos-latest]
13
11
  os: [ubuntu-latest]
14
- # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
15
- # ruby: [2.5, 2.6, 2.7, '3.0', head, jruby, jruby-head, truffleruby, truffleruby-head]
16
- ruby: ["2.7.2", "3.0.1", 3.1.0]
12
+ ruby: ["2.7", "3.0", "3.1", head]
17
13
  test_command: ["bundle exec rake test"]
18
14
  runs-on: ${{ matrix.os }}
19
15
 
20
16
  steps:
21
- - uses: actions/checkout@v2
17
+ - uses: actions/checkout@v3
22
18
  - uses: ruby/setup-ruby@v1
23
19
  with:
24
20
  ruby-version: ${{ matrix.ruby }}
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-3.1.0
1
+ ruby-3.1.3
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ gem "rails"
5
5
 
6
6
  group :test do
7
7
  gem "observr"
8
- gem "standard", require: false
9
- gem "simplecov", require: false
10
8
  gem "ricecream"
9
+ gem "simplecov", require: false
10
+ gem "standard", require: false
11
11
  end
data/MIT-LICENSE CHANGED
@@ -1,4 +1,6 @@
1
- Copyright (c) 2021-2022 Dittmar Krall - www.matique.com
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021-2022 Dittmar Krall (www.matiq.com)
2
4
 
3
5
  Permission is hereby granted, free of charge, to any person obtaining
4
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MiMoCo
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/miau.png)](http://badge.fury.io/rb/mimoco)
3
+ [![Gem Version](https://badge.fury.io/rb/mimoco.png)](http://badge.fury.io/rb/mimoco)
4
4
 
5
5
  Mimoco (MInitest MOdels COntrollers) DRY
6
6
  your tests by specifying some (trivial) of them via a table.
@@ -12,15 +12,16 @@ to detect code changes which often went unseen.
12
12
 
13
13
  ## Installation
14
14
 
15
- ~~~ ruby
15
+ As usual:
16
+ ```ruby
16
17
  # Gemfile
17
18
  gem "mimoco"
18
- ~~~
19
+ ```
19
20
  and run "bundle install".
20
21
 
21
22
  ## Usage for Models
22
23
 
23
- ~~~ ruby
24
+ ```ruby
24
25
  require "test_helper"
25
26
  require "mimoco"
26
27
 
@@ -41,7 +42,7 @@ class ModelsTest < Minitest::Test
41
42
  check_models models
42
43
  end
43
44
  end
44
- ~~~
45
+ ```
45
46
 
46
47
  Furthermore, "valids" and "invalids" accepts an array
47
48
  of hashes to create models to be checked.
@@ -51,7 +52,7 @@ to instantiated a model used to applicate the methods.
51
52
 
52
53
  ## Usage for Controllers
53
54
 
54
- ~~~ ruby
55
+ ```ruby
55
56
  require "test_helper"
56
57
  require "mimoco"
57
58
 
@@ -64,8 +65,17 @@ class ControllersTest < ActionDispatch::IntegrationTest
64
65
  call_class_methods: %i[class_method],
65
66
  public_methods: %i[create destroy edit index new show update]
66
67
  }
68
+ ArticlesController => ...
67
69
  }
70
+
68
71
  check_controllers controllers
69
72
  end
70
73
  end
71
- ~~~
74
+ ```
75
+
76
+ ## Miscellaneous
77
+
78
+ Copyright (c) 2022 Dittmar Krall (www.matiq.com),
79
+ released under the MIT license:
80
+
81
+ * https://opensource.org/licenses/MIT
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
- # rubocop: disable all
3
2
 
4
3
  module Mimoco
5
- VERSION = "0.3.0" # 2022-02-11
6
- # VERSION = "0.2.0" # 2022-01-06
7
- # VERSION = "0.1.0" # 2022-01-03
8
- # VERSION = "0.0.1" # 2021-12-29
4
+ VERSION = "0.3.1" # 2022-12-25
5
+ # VERSION = "0.3.0" # 2022-02-11
6
+ # VERSION = "0.2.0" # 2022-01-06
7
+ # VERSION = "0.1.0" # 2022-01-03
8
+ # VERSION = "0.0.1" # 2021-12-29
9
9
  end
data/lib/mimoco.rb CHANGED
@@ -76,8 +76,8 @@ module Minitest
76
76
 
77
77
  def self.public_methods(expected)
78
78
  cls = @klass.public_instance_methods(false).sort
79
- cls -= %i[autosave_associated_records_for_projects
80
- validate_associated_records_for_projects]
79
+ cls.delete_if { |x| /.*_associated_records_.*/ =~ x }
80
+ # validate_associated_records_for_projects]
81
81
  check_equal expected, cls
82
82
  end
83
83
 
data/mimoco.gemspec CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |s|
9
9
  s.summary = "Mimoco: some minitests for models and controllers"
10
10
  s.description = "Some testing for models and controllers"
11
11
  s.authors = ["Dittmar Krall"]
12
- s.email = ["dittmar.krall@matique.com"]
13
- s.homepage = "http://matique.com"
12
+ s.email = ["dittmar.krall@matiq.com"]
13
+ s.homepage = "http://matiq.com"
14
14
  s.license = "MIT"
15
15
 
16
16
  s.metadata["source_code_uri"] = "https://github.com/matique/mimoco"
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  s.add_development_dependency "combustion"
22
-
23
22
  s.add_development_dependency "minitest"
24
23
  s.add_development_dependency "sqlite3"
25
24
  end
@@ -11,6 +11,7 @@ class ControllersTest < ActionDispatch::IntegrationTest
11
11
  public_methods: %i[create destroy edit index new show update]
12
12
  }
13
13
  }
14
+
14
15
  check_controllers controllers
15
16
  end
16
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mimoco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dittmar Krall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-11 00:00:00.000000000 Z
11
+ date: 2022-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: combustion
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  description: Some testing for models and controllers
56
56
  email:
57
- - dittmar.krall@matique.com
57
+ - dittmar.krall@matiq.com
58
58
  executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
@@ -63,7 +63,6 @@ files:
63
63
  - ".gitignore"
64
64
  - ".ruby-gemset"
65
65
  - ".ruby-version"
66
- - ".watchr"
67
66
  - Gemfile
68
67
  - MIT-LICENSE
69
68
  - README.md
@@ -92,7 +91,7 @@ files:
92
91
  - test/internal/db/schema.rb
93
92
  - test/models/models_test.rb
94
93
  - test/test_helper.rb
95
- homepage: http://matique.com
94
+ homepage: http://matiq.com
96
95
  licenses:
97
96
  - MIT
98
97
  metadata:
@@ -112,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
111
  - !ruby/object:Gem::Version
113
112
  version: '0'
114
113
  requirements: []
115
- rubygems_version: 3.3.3
114
+ rubygems_version: 3.3.26
116
115
  signing_key:
117
116
  specification_version: 4
118
117
  summary: 'Mimoco: some minitests for models and controllers'
data/.watchr DELETED
@@ -1,59 +0,0 @@
1
- TESTING = %w[test]
2
- HH = "#" * 22 unless defined?(HH)
3
- H = "#" * 5 unless defined?(H)
4
-
5
- def usage
6
- puts <<-EOS
7
- Ctrl-\\ or ctrl-4 Running all tests
8
- Ctrl-C Exit
9
- EOS
10
- end
11
-
12
- def run(cmd)
13
- puts "#{HH} #{Time.now} #{HH}"
14
- puts "#{H} #{cmd}"
15
- system "/usr/bin/time --format '#{HH} Elapsed time %E' #{cmd}"
16
- end
17
-
18
- def run_it(type, file)
19
- case type
20
- when "test" then run %(bundle exec ruby -I test #{file})
21
- # when 'spec'; run %(rspec -X #{file})
22
- else; puts "#{H} unknown type: #{type}, file: #{file}"
23
- end
24
- end
25
-
26
- def run_all_tests
27
- puts "\n#{HH} Running all tests #{HH}\n"
28
- TESTING.each { |dir| run "bundle exec rake #{dir}" if File.exist?(dir) }
29
- end
30
-
31
- def run_matching_files(base)
32
- base = base.split("_").first
33
- TESTING.each { |type|
34
- files = Dir["#{type}/**/*.rb"].select { |file| file =~ /#{base}_.*\.rb/ }
35
- run_it type, files.join(" ") unless files.empty?
36
- }
37
- end
38
-
39
- TESTING.each { |type|
40
- watch("#{type}/#{type}_helper\.rb") { run_all_tests }
41
- watch("lib/.*\.rb") { run_all_tests }
42
- watch("#{type}/.*/*_#{type}\.rb") { |match| run_it type, match[0] }
43
- watch("#{type}/data/(.*)\.rb") { |match|
44
- m1 = match[1]
45
- run_matching_files("#{type}/#{m1}/#{m1}_#{type}.rb")
46
- }
47
- }
48
-
49
- %w[rb erb haml slim].each { |type|
50
- watch(".*/(.*)\.#{type}") { |match|
51
- run_matching_files(match[1])
52
- }
53
- }
54
-
55
- # Ctrl-\ or ctrl-4
56
- Signal.trap("QUIT") { run_all_tests }
57
- # Ctrl-C
58
- Signal.trap("INT") { abort("Interrupted\n") }
59
- usage