mutator_rails 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +37 -0
  3. data/.codeclimate.yml +20 -0
  4. data/.gitignore +12 -0
  5. data/.rspec +2 -0
  6. data/.ruby-version +1 -0
  7. data/CODE_OF_CONDUCT.md +46 -0
  8. data/Gemfile +7 -0
  9. data/Gemfile.lock +232 -0
  10. data/LICENSE.md +21 -0
  11. data/README.md +31 -0
  12. data/Rakefile +8 -0
  13. data/app/models/test.rb +7 -0
  14. data/bin/console +15 -0
  15. data/bin/setup +8 -0
  16. data/config/mutator_rails.yml +8 -0
  17. data/defaults.reek +131 -0
  18. data/lib/mutator_rails.rb +33 -0
  19. data/lib/mutator_rails/analyze.rb +27 -0
  20. data/lib/mutator_rails/cleanup.rb +60 -0
  21. data/lib/mutator_rails/config.rb +34 -0
  22. data/lib/mutator_rails/full_mutate.rb +39 -0
  23. data/lib/mutator_rails/guide.rb +69 -0
  24. data/lib/mutator_rails/list_maker.rb +25 -0
  25. data/lib/mutator_rails/mutation_log.rb +112 -0
  26. data/lib/mutator_rails/railtie.rb +18 -0
  27. data/lib/mutator_rails/single_mutate.rb +134 -0
  28. data/lib/mutator_rails/statistics.rb +192 -0
  29. data/lib/mutator_rails/version.rb +5 -0
  30. data/lib/tasks/mutator/analyze.rake +13 -0
  31. data/lib/tasks/mutator/cleanup.rake +13 -0
  32. data/lib/tasks/mutator/mutate_files.rake +12 -0
  33. data/lib/tasks/mutator/mutator.rake +17 -0
  34. data/lib/tasks/mutator/statistics.rake +13 -0
  35. data/log/mutant/analysis.tsv +3 -0
  36. data/log/mutant/guide.txt +1 -0
  37. data/log/mutant/models/test.log +92 -0
  38. data/log/mutant/models/test2.log +92 -0
  39. data/log/mutant/statistics.txt +19 -0
  40. data/mutator_rails.gemspec +37 -0
  41. data/spec/models/test_spec.rb +15 -0
  42. data/spec/mutator_rails/analyze_spec.rb +26 -0
  43. data/spec/mutator_rails/cleanup_spec.rb +13 -0
  44. data/spec/mutator_rails/full_mutate_spec.rb +13 -0
  45. data/spec/mutator_rails/guide_spec.rb +33 -0
  46. data/spec/mutator_rails/list_maker_spec.rb +17 -0
  47. data/spec/mutator_rails/mutation_log_spec.rb +36 -0
  48. data/spec/mutator_rails/single_mutate_spec.rb +111 -0
  49. data/spec/mutator_rails/statistics_spec.rb +48 -0
  50. data/spec/mutator_rails_spec.rb +9 -0
  51. data/spec/spec_helper.rb +49 -0
  52. metadata +306 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7b32df842875e371217d7a7aa82aa04d270a19d7
4
+ data.tar.gz: 75b286bc4b61933d1bb914217cdf47d5b1bf6de6
5
+ SHA512:
6
+ metadata.gz: ed8b727431873fcfb0fd9094c4e6db98f39b7c969f343e2078debe08ab25ea3d8c9175d854cf333ee24055d4db77b03eba6e3714fdd50c98ec9f216891e0b83c
7
+ data.tar.gz: 982ed60c4c39836fc4cecffac94df77cd2d02a4ac1101704fe197761ad12b1acf3e403ad58ae9d84e0c6141c1429a7bfcc6a4361da152a58de5e9957ea67450a
@@ -0,0 +1,37 @@
1
+ version: 2
2
+ jobs:
3
+ build:
4
+ parallelism: 1
5
+ working_directory: ~/mutator_rails
6
+ docker:
7
+ - image: circleci/ruby:2.4.1
8
+ steps:
9
+ - checkout
10
+
11
+ # Restore bundle cache
12
+ - type: cache-restore
13
+ key: mutator_rails-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
14
+
15
+ # Bundle install dependencies
16
+ - run: bundle install --path vendor/bundle
17
+
18
+ # Store bundle cache
19
+ - type: cache-save
20
+ key: mutator_rails-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
21
+ paths:
22
+ - vendor/bundle
23
+
24
+ # Run rspec in parallel
25
+ - type: shell
26
+ command: |
27
+ bundle exec rspec --profile 10 \
28
+ --format RspecJunitFormatter \
29
+ --out /tmp/test-results/rspec.xml \
30
+ --format progress \
31
+ $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
32
+
33
+ # Save artifacts
34
+ - type: store_test_results
35
+ path: /tmp/test-results
36
+
37
+ - run: bundle exec rspec spec/ && CODECLIMATE_REPO_TOKEN=06263aaac18bc4e88f284d77e1acff710652cadadd22476767fa3c6cb861bb39 bundle exec codeclimate-test-reporter
data/.codeclimate.yml ADDED
@@ -0,0 +1,20 @@
1
+ ---
2
+ engines:
3
+ bundler-audit:
4
+ enabled: true
5
+ duplication:
6
+ enabled: true
7
+ config:
8
+ languages:
9
+ - ruby
10
+ fixme:
11
+ enabled: true
12
+ rubocop:
13
+ enabled: true
14
+ ratings:
15
+ paths:
16
+ - Gemfile.lock
17
+ - "**.rake"
18
+ - "**.rb"
19
+ exclude_paths:
20
+ - bin/
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ .idea/
11
+ # rspec failure tracking
12
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.3.3
@@ -0,0 +1,46 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ ## Our Standards
8
+
9
+ Examples of behavior that contributes to creating a positive environment include:
10
+
11
+ * Using welcoming and inclusive language
12
+ * Being respectful of differing viewpoints and experiences
13
+ * Gracefully accepting constructive criticism
14
+ * Focusing on what is best for the community
15
+ * Showing empathy towards other community members
16
+
17
+ Examples of unacceptable behavior by participants include:
18
+
19
+ * The use of sexualized language or imagery and unwelcome sexual attention or advances
20
+ * Trolling, insulting/derogatory comments, and personal or political attacks
21
+ * Public or private harassment
22
+ * Publishing others' private information, such as a physical or electronic address, without explicit permission
23
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
24
+
25
+ ## Our Responsibilities
26
+
27
+ Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
+
29
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ ## Scope
32
+
33
+ This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
+
35
+ ## Enforcement
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at tim@possibilogy.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
+
39
+ Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
+
41
+ ## Attribution
42
+
43
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44
+
45
+ [homepage]: http://contributor-covenant.org
46
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,232 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ mutator_rails (0.1.8)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ abstract_type (0.0.7)
10
+ actioncable (5.1.0)
11
+ actionpack (= 5.1.0)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (~> 0.6.1)
14
+ actionmailer (5.1.0)
15
+ actionpack (= 5.1.0)
16
+ actionview (= 5.1.0)
17
+ activejob (= 5.1.0)
18
+ mail (~> 2.5, >= 2.5.4)
19
+ rails-dom-testing (~> 2.0)
20
+ actionpack (5.1.0)
21
+ actionview (= 5.1.0)
22
+ activesupport (= 5.1.0)
23
+ rack (~> 2.0)
24
+ rack-test (~> 0.6.3)
25
+ rails-dom-testing (~> 2.0)
26
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
+ actionview (5.1.0)
28
+ activesupport (= 5.1.0)
29
+ builder (~> 3.1)
30
+ erubi (~> 1.4)
31
+ rails-dom-testing (~> 2.0)
32
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
+ activejob (5.1.0)
34
+ activesupport (= 5.1.0)
35
+ globalid (>= 0.3.6)
36
+ activemodel (5.1.0)
37
+ activesupport (= 5.1.0)
38
+ activerecord (5.1.0)
39
+ activemodel (= 5.1.0)
40
+ activesupport (= 5.1.0)
41
+ arel (~> 8.0)
42
+ activesupport (5.1.0)
43
+ concurrent-ruby (~> 1.0, >= 1.0.2)
44
+ i18n (~> 0.7)
45
+ minitest (~> 5.1)
46
+ tzinfo (~> 1.1)
47
+ adamantium (0.2.0)
48
+ ice_nine (~> 0.11.0)
49
+ memoizable (~> 0.4.0)
50
+ anima (0.3.0)
51
+ abstract_type (~> 0.0.7)
52
+ adamantium (~> 0.2)
53
+ equalizer (~> 0.0.11)
54
+ arel (8.0.0)
55
+ ast (2.3.0)
56
+ axiom-types (0.1.1)
57
+ descendants_tracker (~> 0.0.4)
58
+ ice_nine (~> 0.11.0)
59
+ thread_safe (~> 0.3, >= 0.3.1)
60
+ builder (3.2.3)
61
+ codeclimate-engine-rb (0.4.0)
62
+ virtus (~> 1.0)
63
+ codeclimate-test-reporter (1.0.8)
64
+ simplecov (<= 0.13)
65
+ coercible (1.0.0)
66
+ descendants_tracker (~> 0.0.1)
67
+ concord (0.1.5)
68
+ adamantium (~> 0.2.0)
69
+ equalizer (~> 0.0.9)
70
+ concurrent-ruby (1.0.5)
71
+ descendants_tracker (0.0.4)
72
+ thread_safe (~> 0.3, >= 0.3.1)
73
+ diff-lcs (1.3)
74
+ docile (1.1.5)
75
+ equalizer (0.0.11)
76
+ erubi (1.6.0)
77
+ globalid (0.4.0)
78
+ activesupport (>= 4.2.0)
79
+ i18n (0.8.1)
80
+ ice_nine (0.11.2)
81
+ json (2.1.0)
82
+ loofah (2.0.3)
83
+ nokogiri (>= 1.5.9)
84
+ mail (2.6.5)
85
+ mime-types (>= 1.16, < 4)
86
+ memoizable (0.4.2)
87
+ thread_safe (~> 0.3, >= 0.3.1)
88
+ method_source (0.8.2)
89
+ mime-types (3.1)
90
+ mime-types-data (~> 3.2015)
91
+ mime-types-data (3.2016.0521)
92
+ mini_portile2 (2.1.0)
93
+ minitest (5.10.2)
94
+ morpher (0.2.6)
95
+ abstract_type (~> 0.0.7)
96
+ adamantium (~> 0.2.0)
97
+ anima (~> 0.3.0)
98
+ ast (~> 2.2)
99
+ concord (~> 0.1.5)
100
+ equalizer (~> 0.0.9)
101
+ ice_nine (~> 0.11.0)
102
+ procto (~> 0.0.2)
103
+ mutant (0.8.14)
104
+ abstract_type (~> 0.0.7)
105
+ adamantium (~> 0.2.0)
106
+ anima (~> 0.3.0)
107
+ ast (~> 2.2)
108
+ concord (~> 0.1.5)
109
+ diff-lcs (~> 1.3)
110
+ equalizer (~> 0.0.9)
111
+ ice_nine (~> 0.11.1)
112
+ memoizable (~> 0.4.2)
113
+ morpher (~> 0.2.6)
114
+ parallel (~> 1.3)
115
+ parser (>= 2.3.1.4, < 2.5)
116
+ procto (~> 0.0.2)
117
+ regexp_parser (~> 0.4.3)
118
+ unparser (~> 0.2.5)
119
+ mutant-rspec (0.8.14)
120
+ mutant (~> 0.8.14)
121
+ rspec-core (>= 3.4.0, < 3.7.0)
122
+ nio4r (2.0.0)
123
+ nokogiri (1.7.2)
124
+ mini_portile2 (~> 2.1.0)
125
+ parallel (1.11.2)
126
+ parser (2.4.0.0)
127
+ ast (~> 2.2)
128
+ procto (0.0.3)
129
+ rack (2.0.3)
130
+ rack-test (0.6.3)
131
+ rack (>= 1.0)
132
+ rails (5.1.0)
133
+ actioncable (= 5.1.0)
134
+ actionmailer (= 5.1.0)
135
+ actionpack (= 5.1.0)
136
+ actionview (= 5.1.0)
137
+ activejob (= 5.1.0)
138
+ activemodel (= 5.1.0)
139
+ activerecord (= 5.1.0)
140
+ activesupport (= 5.1.0)
141
+ bundler (>= 1.3.0, < 2.0)
142
+ railties (= 5.1.0)
143
+ sprockets-rails (>= 2.0.0)
144
+ rails-dom-testing (2.0.3)
145
+ activesupport (>= 4.2.0)
146
+ nokogiri (>= 1.6)
147
+ rails-html-sanitizer (1.0.3)
148
+ loofah (~> 2.0)
149
+ railties (5.1.0)
150
+ actionpack (= 5.1.0)
151
+ activesupport (= 5.1.0)
152
+ method_source
153
+ rake (>= 0.8.7)
154
+ thor (>= 0.18.1, < 2.0)
155
+ rainbow (2.2.2)
156
+ rake
157
+ rake (12.3.0)
158
+ reek (4.7.2)
159
+ codeclimate-engine-rb (~> 0.4.0)
160
+ parser (>= 2.4.0.0, < 2.5)
161
+ rainbow (~> 2.0)
162
+ regexp_parser (0.4.4)
163
+ rspec-collection_matchers (1.1.3)
164
+ rspec-expectations (>= 2.99.0.beta1)
165
+ rspec-core (3.6.0)
166
+ rspec-support (~> 3.6.0)
167
+ rspec-expectations (3.6.0)
168
+ diff-lcs (>= 1.2.0, < 2.0)
169
+ rspec-support (~> 3.6.0)
170
+ rspec-mocks (3.6.0)
171
+ diff-lcs (>= 1.2.0, < 2.0)
172
+ rspec-support (~> 3.6.0)
173
+ rspec-support (3.6.0)
174
+ rspec_junit_formatter (0.2.3)
175
+ builder (< 4)
176
+ rspec-core (>= 2, < 4, != 2.12.0)
177
+ simplecov (0.13.0)
178
+ docile (~> 1.1.0)
179
+ json (>= 1.8, < 3)
180
+ simplecov-html (~> 0.10.0)
181
+ simplecov-html (0.10.1)
182
+ sprockets (3.7.1)
183
+ concurrent-ruby (~> 1.0)
184
+ rack (> 1, < 3)
185
+ sprockets-rails (3.2.0)
186
+ actionpack (>= 4.0)
187
+ activesupport (>= 4.0)
188
+ sprockets (>= 3.0.0)
189
+ thor (0.19.4)
190
+ thread_safe (0.3.6)
191
+ tzinfo (1.2.3)
192
+ thread_safe (~> 0.1)
193
+ unparser (0.2.6)
194
+ abstract_type (~> 0.0.7)
195
+ adamantium (~> 0.2.0)
196
+ concord (~> 0.1.5)
197
+ diff-lcs (~> 1.3)
198
+ equalizer (~> 0.0.9)
199
+ parser (>= 2.3.1.2, < 2.5)
200
+ procto (~> 0.0.2)
201
+ virtus (1.0.5)
202
+ axiom-types (~> 0.1)
203
+ coercible (~> 1.0)
204
+ descendants_tracker (~> 0.0, >= 0.0.3)
205
+ equalizer (~> 0.0, >= 0.0.9)
206
+ websocket-driver (0.6.5)
207
+ websocket-extensions (>= 0.1.0)
208
+ websocket-extensions (0.1.2)
209
+
210
+ PLATFORMS
211
+ ruby
212
+
213
+ DEPENDENCIES
214
+ adamantium (~> 0.2.0)
215
+ bundler (~> 1.15)
216
+ codeclimate-test-reporter
217
+ concord (~> 0.1.4)
218
+ mutant (~> 0.8.14)
219
+ mutant-rspec (~> 0.8.14)
220
+ mutator_rails!
221
+ procto (~> 0.0.3)
222
+ rails (>= 4.0)
223
+ rake (~> 12.0)
224
+ reek (~> 4.7.2)
225
+ rspec-collection_matchers
226
+ rspec-core (~> 3.6.0)
227
+ rspec-expectations (~> 3.6.0)
228
+ rspec-mocks (~> 3.6.0)
229
+ rspec_junit_formatter
230
+
231
+ BUNDLED WITH
232
+ 1.16.0.pre.2
data/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Tim Chambers, Jason Dinsmore
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # MutatorRails
2
+
3
+ Integrate automated mutation testing into your Rails application
4
+
5
+ ## Installation
6
+
7
+ Add these lines to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'mutant'
11
+ gem 'mutant-rspec'
12
+ gem 'mutator_rails', github: 'dinj-oss/mutator_rails'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Development
24
+
25
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
+
27
+ 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).
28
+
29
+ ## Contributing
30
+
31
+ Bug reports and pull requests are welcome on GitHub at https://github.com/dinj-oss/mutator_rails.
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Test
4
+ def call
5
+ puts 'does something'
6
+ end
7
+ end