transpec 3.0.4 → 3.0.5
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/transpec/cli.rb +2 -2
- data/lib/transpec/project.rb +15 -8
- data/lib/transpec/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d40aebdbb1e1f3e66aff593224f873193f187919
|
4
|
+
data.tar.gz: 5699ff25b4e218514844def74918519cec54c69a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac3ae1a634b6d1e2355509134bd685e2bd26e322fefba06ae2e5b5b994530f23bf497e8049fa827c7774a5dda07d5d807b0cd30bfc8719b0667f25bad5b86158
|
7
|
+
data.tar.gz: 75fd01a09e678f449a61b40a77f31394b9900bbe6edb2b95c0aab8446fc0a3d7d19bdd4c9812606a96f5ff8fe61ecd79c73d3dfb9d7c9d87fc94eff1eea204ba
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## Development
|
4
4
|
|
5
|
+
## v3.0.5
|
6
|
+
|
7
|
+
* Abort processing if the project has a `Gemfile` but no `Gemfile.lock`.
|
8
|
+
|
5
9
|
## v3.0.4
|
6
10
|
|
7
11
|
* Fix an issue where `obj = Klass.any_instance; obj.should_receive(:message)` was not properly converted to `expect_any_instance_of(Klass).to receive(:message)` when run on RSpec 3.
|
data/lib/transpec/cli.rb
CHANGED
@@ -28,7 +28,7 @@ module Transpec
|
|
28
28
|
def run(args)
|
29
29
|
begin
|
30
30
|
paths = OptionParser.new(config).parse(args)
|
31
|
-
|
31
|
+
validate!
|
32
32
|
rescue => error
|
33
33
|
warn error.message
|
34
34
|
return false
|
@@ -95,7 +95,7 @@ module Transpec
|
|
95
95
|
|
96
96
|
private
|
97
97
|
|
98
|
-
def
|
98
|
+
def validate!
|
99
99
|
unless config.forced?
|
100
100
|
if Git.command_available? && Git.inside_of_repository? && !Git.clean?
|
101
101
|
fail 'The current Git repository is not clean. Aborting. ' \
|
data/lib/transpec/project.rb
CHANGED
@@ -17,7 +17,8 @@ module Transpec
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def using_bundler?
|
20
|
-
File.
|
20
|
+
gemfile_path = File.join(path, 'Gemfile')
|
21
|
+
File.exist?(gemfile_path)
|
21
22
|
end
|
22
23
|
|
23
24
|
def depend_on_rspec_rails?
|
@@ -45,15 +46,19 @@ module Transpec
|
|
45
46
|
private
|
46
47
|
|
47
48
|
def dependency_gems
|
48
|
-
@dependency_gems
|
49
|
-
|
50
|
-
|
51
|
-
lockfile.specs
|
52
|
-
end
|
49
|
+
return @dependency_gems if @dependency_gems
|
50
|
+
lockfile = Bundler::LockfileParser.new(gemfile_lock_content)
|
51
|
+
@dependency_gems = lockfile.specs
|
53
52
|
end
|
54
53
|
|
55
|
-
def
|
56
|
-
|
54
|
+
def gemfile_lock_content
|
55
|
+
gemfile_lock_path = File.join(path, 'Gemfile.lock')
|
56
|
+
|
57
|
+
if File.exist?(gemfile_lock_path)
|
58
|
+
File.read(gemfile_lock_path)
|
59
|
+
else
|
60
|
+
fail GemfileLockNotFoundError, 'Gemfile.lock is missing. Please run `bundle install`.'
|
61
|
+
end
|
57
62
|
end
|
58
63
|
|
59
64
|
def fetch_rspec_version
|
@@ -65,5 +70,7 @@ module Transpec
|
|
65
70
|
RSpec::Core::Version::STRING
|
66
71
|
end
|
67
72
|
end
|
73
|
+
|
74
|
+
class GemfileLockNotFoundError < StandardError; end
|
68
75
|
end
|
69
76
|
end
|
data/lib/transpec/version.rb
CHANGED