hexx-suit 0.2.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.coveralls.yml +1 -0
  3. data/.travis.yml +4 -9
  4. data/Gemfile +5 -6
  5. data/README.md +35 -26
  6. data/Rakefile +5 -6
  7. data/{lib/hexx/suit/install → config}/metrics/simplecov.yml +0 -0
  8. data/hexx-suit.gemspec +1 -6
  9. data/lib/hexx/suit/install/Guardfile +14 -5
  10. data/lib/hexx/suit/install/_rubocop.yml +1 -0
  11. data/lib/hexx/suit/install/_yardopts +1 -0
  12. data/lib/hexx/suit/install.rb +15 -46
  13. data/lib/hexx/suit/metrics/metric_fu/base.rb +15 -7
  14. data/lib/hexx/suit/metrics/metric_fu/cane.rb +1 -1
  15. data/lib/hexx/suit/metrics/metric_fu/churn.rb +1 -1
  16. data/lib/hexx/suit/metrics/metric_fu/flay.rb +1 -1
  17. data/lib/hexx/suit/metrics/metric_fu/reek.rb +1 -1
  18. data/lib/hexx/suit/metrics/metric_fu/roodi.rb +1 -1
  19. data/lib/hexx/suit/metrics/metric_fu/saikuro.rb +1 -1
  20. data/lib/hexx/suit/metrics/metric_fu.rb +1 -1
  21. data/lib/hexx/suit/metrics/rubocop.rb +1 -1
  22. data/lib/hexx/suit/metrics/yardstick.rb +1 -1
  23. data/lib/hexx/suit/metrics.rb +0 -3
  24. data/lib/hexx/suit/version.rb +7 -1
  25. data/lib/hexx/suit.rb +14 -67
  26. data/lib/hexx-suit.rb +10 -14
  27. data/lib/tasks/check/coverage.rake +2 -2
  28. data/lib/tasks/check/fu.rake +1 -1
  29. data/lib/tasks/check/inch.rake +1 -1
  30. data/lib/tasks/check/rubocop.rake +1 -1
  31. data/lib/tasks/check/yardstick.rake +1 -1
  32. data/lib/tasks/check.rake +9 -11
  33. data/lib/tasks/debug.rake +1 -1
  34. data/lib/tasks/test.rake +1 -1
  35. data/spec/spec_helper.rb +8 -6
  36. data/spec/support/config/tasks.rb +1 -1
  37. data/spec/tests/bin/install_spec.rb +22 -25
  38. data/spec/tests/lib/install_spec.rb +0 -4
  39. data/spec/tests/suit_spec.rb +7 -55
  40. data/spec/tests/tasks/check/coverage/display_spec.rb +2 -2
  41. data/spec/tests/tasks/check/coverage/run_spec.rb +2 -2
  42. data/spec/tests/tasks/check/display_spec.rb +0 -6
  43. data/spec/tests/tasks/check/fu/display_spec.rb +1 -1
  44. data/spec/tests/tasks/check/fu/run_spec.rb +1 -1
  45. data/spec/tests/tasks/check/inch_spec.rb +1 -1
  46. data/spec/tests/tasks/check/rubocop/display_spec.rb +1 -1
  47. data/spec/tests/tasks/check/rubocop/run_spec.rb +1 -1
  48. data/spec/tests/tasks/check/run_spec.rb +0 -6
  49. data/spec/tests/tasks/check/yardstick/display_spec.rb +1 -1
  50. data/spec/tests/tasks/check_spec.rb +0 -12
  51. data/spec/tests/tasks/debug_spec.rb +1 -1
  52. metadata +6 -103
  53. data/config/initializers/focus.rb +0 -5
  54. data/config/initializers/garbage_collection.rb +0 -11
  55. data/config/initializers/i18n.rb +0 -3
  56. data/config/initializers/random_order.rb +0 -4
  57. data/config/initializers/rspec.rb +0 -11
  58. data/lib/hexx/suit/install/Rakefile +0 -17
  59. data/lib/hexx/suit/install/_rspec +0 -2
  60. data/lib/hexx/suit/install/metrics/pippi.yml +0 -3
  61. data/lib/hexx/suit/metrics/base.rb +0 -88
  62. data/lib/hexx/suit/metrics/pippi.rb +0 -89
  63. data/lib/hexx/suit/metrics/simplecov.rb +0 -119
  64. data/lib/hexx/suit/utils/system.rb +0 -66
  65. data/lib/tasks/check/pippi.rake +0 -33
  66. data/spec/tests/lib/metrics/pippi_spec.rb +0 -104
  67. data/spec/tests/lib/metrics/simplecov_spec.rb +0 -102
  68. data/spec/tests/lib/utils/system_spec.rb +0 -85
  69. data/spec/tests/tasks/check/pippi/display_spec.rb +0 -48
  70. data/spec/tests/tasks/check/pippi/run_spec.rb +0 -26
  71. data/spec/tests/tasks/check/pippi_spec.rb +0 -27
  72. data/spec/tests/tasks/test_spec.rb +0 -21
@@ -1,85 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe Hexx::Suit::Utils::System do
4
-
5
- it "is a string" do
6
- subject = described_class.new ""
7
- expect(subject).to be_kind_of String
8
- end
9
-
10
- describe ".new" do
11
-
12
- it "removes repetitive spaces from source" do
13
- subject = described_class.new "foo bar \n baz"
14
-
15
- expect(subject).to eq "foo bar \n baz"
16
- end
17
-
18
- it "strips the source" do
19
- subject = described_class.new " foo bar \n baz "
20
-
21
- expect(subject).to eq "foo bar \n baz"
22
- end
23
- end
24
-
25
- describe "#lines" do
26
-
27
- it "strips lines" do
28
- subject = described_class.new " foo bar \n baz "
29
-
30
- expect(subject.lines).to eq ["foo bar", "baz"]
31
- end
32
-
33
- it "ignores empty lines" do
34
- subject = described_class.new " \nfoo bar\n \nbaz\n "
35
-
36
- expect(subject.lines).to eq ["foo bar", "baz"]
37
- end
38
-
39
- it "returns an array of utilities" do
40
- subject = described_class.new "foo bar\nbaz"
41
-
42
- subject.lines.each { |line| expect(line).to be_kind_of described_class }
43
- end
44
- end
45
-
46
- describe "#call" do
47
-
48
- before { allow_any_instance_of(described_class).to receive :system }
49
- after { subject.call }
50
-
51
- context "single line" do
52
-
53
- subject { described_class.new "foo bar" }
54
-
55
- it "sends itself to system" do
56
- expect(subject).to receive(:system).with(subject)
57
- end
58
- end
59
-
60
- context "multiline string" do
61
-
62
- subject { described_class.new "foo bar\nbaz" }
63
-
64
- it "sends each line to system" do
65
- subject.lines.each do |line|
66
- expect(subject).to receive(:system).with(line).ordered
67
- end
68
- end
69
- end
70
- end
71
-
72
- describe ".call" do
73
-
74
- let!(:value) { "foo bar\nbaz" }
75
- let!(:utility) { described_class.new value }
76
-
77
- before { allow(described_class).to receive(:new) { utility } }
78
-
79
- it "constucts the utility object and calls it" do
80
- expect(described_class).to receive(:new).with(value)
81
- expect(utility).to receive :call
82
- described_class.call value
83
- end
84
- end
85
- end
@@ -1,48 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe "Rake::Task['check:pippi:display']", :tasks do
4
-
5
- # The {#commands} variable is defined in the spec/support/config/tasks.rb
6
- # It collects the list of commands, that has been sent to system by
7
- # any instance of Hexx::Suit::Utils::System utility.
8
-
9
- let(:metric) { Hexx::Suit::Metrics::Pippi }
10
- let(:task) { Rake::Task["check:pippi:display"] }
11
-
12
- describe ".invoke", :sandbox do
13
-
14
- subject { try_in_sandbox { task.invoke } }
15
-
16
- context "when '.metrics.yml' is absent" do
17
-
18
- it "loads the metric" do
19
- expect(metric).to receive(:load)
20
- subject
21
- end
22
-
23
- it "displays the output" do
24
- expect { subject }
25
- .to change { commands.include? "cat tmp/pippi/output.log" }
26
- .to true
27
- end
28
- end
29
-
30
- context "when '.metrics.yml' is present" do
31
-
32
- let(:options) { { "output" => "custom/pippi.log" } }
33
- before { prepare_settings options, "config/metrics/pippi.yml" }
34
-
35
- it "loads the metric" do
36
- expect(metric).to receive(:load)
37
- subject
38
- end
39
-
40
- it "uses the custom output" do
41
- expect { subject }
42
- .to change { commands.include? "cat #{ options['output'] }" }
43
- .to true
44
- end
45
- end
46
- end
47
-
48
- end if USE_PIPPI_METRIC
@@ -1,26 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe "Rake::Task['check:pippi:run']", :tasks do
4
-
5
- # The {#commands} variable is defined in the spec/support/config/tasks.rb
6
- # It collects the list of commands, that has been sent to system by
7
- # any instance of Hexx::Suit::Utils::System utility.
8
-
9
- let(:metric) { Hexx::Suit::Metrics::Pippi }
10
- let(:task) { Rake::Task["check:pippi:run"] }
11
-
12
- describe ".invoke", :sandbox do
13
-
14
- subject { try_in_sandbox { task.invoke } }
15
-
16
- it "loads the metric" do
17
- expect(metric).to receive(:load)
18
- subject
19
- end
20
-
21
- it "runs tests" do
22
- expect { subject }.to change { commands.include? "rake test" }.to true
23
- end
24
- end
25
-
26
- end if USE_PIPPI_METRIC
@@ -1,27 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe "Rake::Task['check:pippi']", :tasks do
4
-
5
- # The {#task_invoked?} helper is defined in the spec/support/config/tasks.rb
6
- # It checks if a task has been invoked.
7
-
8
- let(:task) { Rake::Task["check:pippi"] }
9
-
10
- describe ".invoke", :sandbox do
11
-
12
- subject { try_in_sandbox { task.invoke } }
13
-
14
- it "invokes check:pippi:run" do
15
- expect { subject }
16
- .to change { task_invoked? "check:pippi:run" }
17
- .to(true)
18
- end
19
-
20
- it "invokes check:pippi:display" do
21
- expect { subject }
22
- .to change { task_invoked? "check:pippi:display" }
23
- .to(true)
24
- end
25
- end
26
-
27
- end if USE_PIPPI_METRIC
@@ -1,21 +0,0 @@
1
- # encoding: utf-8
2
-
3
- describe "Rake::Task[:test]", :tasks do
4
-
5
- # The {#commands} variable is defined in the spec/support/config/tasks.rb
6
- # It collects the list of commands, that has been sent to system by
7
- # any instance of Hexx::Suit::Utils::System utility.
8
-
9
- let(:task) { Rake::Task[:test] }
10
-
11
- describe ".invoke", :sandbox do
12
-
13
- subject { try_in_sandbox { task.invoke } }
14
-
15
- it "runs tests" do
16
- expect { subject }.to change { commands }.to [
17
- "bundle exec rspec spec"
18
- ]
19
- end
20
- end
21
- end