hexx-rspec 0.0.1 → 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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67652175ea9eb8c746d5a6ad79ab0c7976127d2c
|
4
|
+
data.tar.gz: 8003dc0d6a042e99bcfbef02e508d2c3553c3f79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a602ca2e93cffcd4545b0198f890a5ed77d7244f69662a127d5ce8e2b1046fd80c842980cd42a8a20ce9bf855b422ca3e81453e0d33e0c6265ca9ee8f172bf5b
|
7
|
+
data.tar.gz: b1a6292022ee603ee0bd6977836e43eb541ada5da54c077f762a1d59da6ca40f509b9327cb91c8fe7bb0d752a575bcb8c04b4556e4e4ca880940dbdb51d49fcb
|
data/lib/hexx/rspec/install.rb
CHANGED
@@ -13,6 +13,13 @@ module Hexx
|
|
13
13
|
#
|
14
14
|
# @api public
|
15
15
|
|
16
|
+
class_option(
|
17
|
+
:rakefile,
|
18
|
+
default: true,
|
19
|
+
desc: "Create the Rakefile",
|
20
|
+
type: :boolean
|
21
|
+
)
|
22
|
+
|
16
23
|
# @private
|
17
24
|
def self.source_root
|
18
25
|
@source_root ||= File.expand_path "../install", __FILE__
|
@@ -23,6 +30,7 @@ module Hexx
|
|
23
30
|
|
24
31
|
# @private
|
25
32
|
def create_rakefile
|
33
|
+
return unless options[:rakefile]
|
26
34
|
copy_file "Rakefile"
|
27
35
|
end
|
28
36
|
|
data/lib/hexx/rspec/version.rb
CHANGED
@@ -4,18 +4,46 @@ describe Hexx::RSpec::Install, :sandbox do
|
|
4
4
|
|
5
5
|
describe ".start" do
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
7
|
+
subject { try_in_sandbox { described_class.start options } }
|
8
|
+
|
9
|
+
context "without options" do
|
10
|
+
|
11
|
+
let(:options) { %w() }
|
12
|
+
before { subject }
|
13
|
+
|
14
|
+
it "creates necessary files" do
|
15
|
+
%w(
|
16
|
+
.rspec
|
17
|
+
Rakefile
|
18
|
+
config/metrics/simplecov.yml
|
19
|
+
).each { |file| expect(file).to be_present_in_sandbox }
|
20
|
+
end
|
21
|
+
|
22
|
+
it "adds Hexx::RSpec tasks loader to Rakefile" do
|
23
|
+
expect(read_in_sandbox "Rakefile")
|
24
|
+
.to include "Hexx::RSpec.install_tasks"
|
25
|
+
end
|
26
|
+
|
27
|
+
end # context
|
28
|
+
|
29
|
+
context "--no-rakefile" do
|
30
|
+
|
31
|
+
let(:options) { %w(--no-rakefile) }
|
32
|
+
before { subject }
|
33
|
+
|
34
|
+
it "creates necessary files" do
|
35
|
+
%w(
|
36
|
+
.rspec
|
37
|
+
config/metrics/simplecov.yml
|
38
|
+
).each { |file| expect(file).to be_present_in_sandbox }
|
39
|
+
end
|
40
|
+
|
41
|
+
it "doesn't create a Rakefile" do
|
42
|
+
expect("Rakefile").to be_absent_in_sandbox
|
43
|
+
end
|
44
|
+
|
45
|
+
end # context
|
46
|
+
|
47
|
+
end # describe .start
|
48
|
+
|
49
|
+
end # describe Hexx::RSpec::Install
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hexx-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kozin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|
@@ -146,8 +146,6 @@ files:
|
|
146
146
|
- spec/tests/lib/metrics/simplecov_spec.rb
|
147
147
|
- spec/tests/lib/system_spec.rb
|
148
148
|
- spec/tests/rspec_spec.rb
|
149
|
-
- spec/tests/tasks/test/coverage/display_spec.rb
|
150
|
-
- spec/tests/tasks/test/coverage/run_spec.rb
|
151
149
|
- spec/tests/tasks/test/coverage_spec.rb
|
152
150
|
- spec/tests/tasks/test_spec.rb
|
153
151
|
homepage: https://github.com/nepalez/hexx-rspec
|
@@ -180,8 +178,6 @@ test_files:
|
|
180
178
|
- spec/tests/lib/system_spec.rb
|
181
179
|
- spec/tests/lib/install_spec.rb
|
182
180
|
- spec/tests/tasks/test_spec.rb
|
183
|
-
- spec/tests/tasks/test/coverage/run_spec.rb
|
184
|
-
- spec/tests/tasks/test/coverage/display_spec.rb
|
185
181
|
- spec/tests/tasks/test/coverage_spec.rb
|
186
182
|
- spec/tests/bin/install_spec.rb
|
187
183
|
- spec/tests/rspec_spec.rb
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
describe "Rake::Task['test:coverage: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::RSpec::System utility.
|
8
|
-
|
9
|
-
let(:metric) { Hexx::RSpec::Metrics::SimpleCov }
|
10
|
-
let(:task) { Rake::Task["test:coverage: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 default output" do
|
24
|
-
expect { subject }.to change { commands }.to [
|
25
|
-
"launchy tmp/coverage/index.html"
|
26
|
-
]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
context "when '.metrics.yml' is present" do
|
31
|
-
|
32
|
-
let(:output) { "tmp/coverage" }
|
33
|
-
before do
|
34
|
-
prepare_settings "simplecov" => { "output" => output }
|
35
|
-
end
|
36
|
-
|
37
|
-
it "loads the metric" do
|
38
|
-
expect(metric).to receive(:load)
|
39
|
-
subject
|
40
|
-
end
|
41
|
-
|
42
|
-
it "uses the custom output folder" do
|
43
|
-
expect { subject }.to change { commands }.to [
|
44
|
-
"launchy #{ output }/index.html"
|
45
|
-
]
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
describe "Rake::Task['test:coverage: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::RSpec::System utility.
|
8
|
-
|
9
|
-
let(:metric) { Hexx::RSpec::Metrics::SimpleCov }
|
10
|
-
let(:task) { Rake::Task["test:coverage: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 }.to ["rake test"]
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|