transpec 2.3.8 → 3.0.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 +4 -4
- data/.rubocop.yml +11 -0
- data/CHANGELOG.md +8 -1
- data/Gemfile +0 -2
- data/Guardfile +2 -2
- data/README.md +16 -16
- data/README.md.erb +9 -9
- data/lib/transpec/cli.rb +12 -13
- data/lib/transpec/config.rb +1 -1
- data/lib/transpec/converter.rb +11 -7
- data/lib/transpec/dynamic_analyzer.rb +2 -2
- data/lib/transpec/git.rb +5 -4
- data/lib/transpec/option_parser.rb +8 -8
- data/lib/transpec/processed_source.rb +4 -7
- data/lib/transpec/project.rb +18 -5
- data/lib/transpec/spec_suite.rb +9 -6
- data/lib/transpec/syntax.rb +13 -5
- data/lib/transpec/syntax/method_stub.rb +1 -1
- data/lib/transpec/syntax/mixin/matcher_owner.rb +3 -1
- data/lib/transpec/syntax/mixin/owned_matcher.rb +4 -2
- data/lib/transpec/syntax/mixin/rspec_rails.rb +1 -1
- data/lib/transpec/syntax/oneliner_should.rb +1 -1
- data/lib/transpec/syntax/operator.rb +4 -2
- data/lib/transpec/syntax/rspec_configure.rb +1 -1
- data/lib/transpec/version.rb +3 -3
- data/spec/spec_helper.rb +1 -4
- data/spec/support/shared_context.rb +6 -1
- data/spec/transpec/config_spec.rb +1 -1
- data/spec/transpec/converter_spec.rb +10 -5
- data/spec/transpec/dynamic_analyzer_spec.rb +6 -6
- data/spec/transpec/git_spec.rb +22 -33
- data/spec/transpec/option_parser_spec.rb +4 -4
- data/spec/transpec/project_spec.rb +118 -7
- data/spec/transpec/spec_suite_spec.rb +4 -3
- data/spec/transpec/syntax/current_example_spec.rb +2 -2
- data/spec/transpec/syntax/double_spec.rb +1 -1
- data/spec/transpec/syntax/example_group_spec.rb +309 -164
- data/spec/transpec/syntax/example_spec.rb +1 -1
- data/spec/transpec/syntax/have_spec.rb +1 -1
- data/spec/transpec/syntax/its_spec.rb +1 -1
- data/spec/transpec/syntax/method_stub_spec.rb +7 -10
- data/spec/transpec/syntax/oneliner_should_spec.rb +1 -1
- data/spec/transpec/syntax/pending_spec.rb +1 -1
- data/spec/transpec/syntax/rspec_configure_spec.rb +66 -57
- data/tasks/readme.rake +12 -3
- metadata +3 -3
data/lib/transpec/spec_suite.rb
CHANGED
@@ -10,17 +10,20 @@ module Transpec
|
|
10
10
|
class SpecSuite
|
11
11
|
include Syntax::Dispatcher
|
12
12
|
|
13
|
-
attr_reader :runtime_data
|
13
|
+
attr_reader :project, :target_paths, :runtime_data
|
14
14
|
|
15
|
-
def initialize(
|
16
|
-
@
|
15
|
+
def initialize(project = Project.new, target_paths = [], runtime_data = nil)
|
16
|
+
@project = project
|
17
|
+
@target_paths = target_paths
|
17
18
|
@runtime_data = runtime_data
|
18
19
|
@analyzed = false
|
19
20
|
end
|
20
21
|
|
21
22
|
def specs
|
22
|
-
@specs ||=
|
23
|
-
|
23
|
+
@specs ||= Dir.chdir(project.path) do
|
24
|
+
SpecFileFinder.find(target_paths).map do |path|
|
25
|
+
ProcessedSource.from_file(path)
|
26
|
+
end
|
24
27
|
end
|
25
28
|
end
|
26
29
|
|
@@ -30,7 +33,7 @@ module Transpec
|
|
30
33
|
specs.each do |spec|
|
31
34
|
next unless spec.ast
|
32
35
|
spec.ast.each_node do |node|
|
33
|
-
dispatch_node(node,
|
36
|
+
dispatch_node(node, runtime_data, project)
|
34
37
|
end
|
35
38
|
end
|
36
39
|
|
data/lib/transpec/syntax.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'transpec/conversion_error'
|
4
4
|
require 'transpec/dynamic_analyzer/runtime_data'
|
5
|
+
require 'transpec/project'
|
5
6
|
require 'transpec/record'
|
6
7
|
require 'transpec/report'
|
7
8
|
require 'transpec/static_context_inspector'
|
@@ -53,12 +54,14 @@ end
|
|
53
54
|
module Transpec
|
54
55
|
class Syntax
|
55
56
|
module Dispatcher
|
56
|
-
|
57
|
+
# rubocop:disable LineLength
|
58
|
+
def dispatch_node(node, runtime_data = nil, project = nil, source_rewriter = nil, report = nil)
|
57
59
|
Syntax.standalone_syntaxes.find do |syntax_class|
|
58
|
-
syntax = syntax_class.new(node,
|
60
|
+
syntax = syntax_class.new(node, runtime_data, project, source_rewriter, report)
|
59
61
|
dispatch_syntax(syntax)
|
60
62
|
end
|
61
63
|
end
|
64
|
+
# rubocop:enable LineLength
|
62
65
|
|
63
66
|
def dispatch_syntax(syntax)
|
64
67
|
return false unless syntax.conversion_target?
|
@@ -145,7 +148,7 @@ module Transpec
|
|
145
148
|
extend Collection
|
146
149
|
include Rewritable, DynamicAnalysis
|
147
150
|
|
148
|
-
attr_reader :node, :
|
151
|
+
attr_reader :node, :runtime_data, :project, :source_rewriter, :report
|
149
152
|
|
150
153
|
def self.standalone?
|
151
154
|
true
|
@@ -155,10 +158,11 @@ module Transpec
|
|
155
158
|
@snake_cake_name ||= ModuleUtil.snake_case_name(name)
|
156
159
|
end
|
157
160
|
|
158
|
-
def initialize(node,
|
161
|
+
def initialize(node, runtime_data = nil, project = nil, source_rewriter = nil, report = nil)
|
159
162
|
@node = node
|
160
|
-
@source_rewriter = source_rewriter
|
161
163
|
@runtime_data = runtime_data || DynamicAnalyzer::RuntimeData.new
|
164
|
+
@project = project || Project.new
|
165
|
+
@source_rewriter = source_rewriter
|
162
166
|
@report = report || Report.new
|
163
167
|
end
|
164
168
|
|
@@ -186,6 +190,10 @@ module Transpec
|
|
186
190
|
node.loc.expression
|
187
191
|
end
|
188
192
|
|
193
|
+
def rspec_version
|
194
|
+
project.rspec_version
|
195
|
+
end
|
196
|
+
|
189
197
|
def inspect
|
190
198
|
"#<#{self.class}: #{node.type}>"
|
191
199
|
end
|
@@ -15,7 +15,9 @@ module Transpec
|
|
15
15
|
|
16
16
|
define_method(accessor) do
|
17
17
|
return instance_variable_get(ivar) if instance_variable_defined?(ivar)
|
18
|
-
matcher = matcher_class.new(
|
18
|
+
matcher = matcher_class.new(
|
19
|
+
matcher_node, self, runtime_data, project, source_rewriter, report
|
20
|
+
)
|
19
21
|
instance_variable_set(ivar, matcher)
|
20
22
|
end
|
21
23
|
|
@@ -18,10 +18,12 @@ module Transpec
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
# rubocop:disable LineLength
|
22
|
+
def initialize(node, expectation, runtime_data = nil, project = nil, source_rewriter = nil, report = nil)
|
23
|
+
super(node, runtime_data, project, source_rewriter, report)
|
23
24
|
@expectation = expectation
|
24
25
|
end
|
26
|
+
# rubocop:enable LineLength
|
25
27
|
end
|
26
28
|
end
|
27
29
|
end
|
@@ -74,7 +74,7 @@ module Transpec
|
|
74
74
|
|
75
75
|
found = Syntax.all_syntaxes.find do |syntax_class|
|
76
76
|
next unless syntax_class.ancestors.include?(Mixin::Examplish)
|
77
|
-
syntax = syntax_class.new(send_node,
|
77
|
+
syntax = syntax_class.new(send_node, runtime_data, project, source_rewriter)
|
78
78
|
next unless syntax.conversion_target?
|
79
79
|
@example = syntax
|
80
80
|
end
|
@@ -21,14 +21,16 @@ module Transpec
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def initialize(
|
24
|
+
def initialize(*args)
|
25
|
+
node = args.shift
|
26
|
+
|
25
27
|
operator_node = if node == BE_NODE
|
26
28
|
node.parent
|
27
29
|
else
|
28
30
|
node
|
29
31
|
end
|
30
32
|
|
31
|
-
super(operator_node,
|
33
|
+
super(operator_node, *args)
|
32
34
|
end
|
33
35
|
|
34
36
|
def dynamic_analysis_target?
|
@@ -67,7 +67,7 @@ module Transpec
|
|
67
67
|
!find_config_node(:infer_spec_type_from_file_location!).nil?
|
68
68
|
end
|
69
69
|
|
70
|
-
def convert_deprecated_options!
|
70
|
+
def convert_deprecated_options! # rubocop:disable MethodLength
|
71
71
|
replace_config!(:backtrace_clean_patterns, :backtrace_exclusion_patterns)
|
72
72
|
replace_config!(:backtrace_clean_patterns=, :backtrace_exclusion_patterns=)
|
73
73
|
replace_config!(:color_enabled=, :color=)
|
data/lib/transpec/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -33,15 +33,12 @@ RSpec.configure do |config|
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
if ENV['TRAVIS'] || ENV['
|
36
|
+
if ENV['TRAVIS'] || ENV['COVERAGE']
|
37
37
|
require 'simplecov'
|
38
38
|
|
39
39
|
if ENV['TRAVIS']
|
40
40
|
require 'coveralls'
|
41
41
|
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
42
|
-
elsif ENV['CI']
|
43
|
-
require 'simplecov-rcov'
|
44
|
-
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
|
45
42
|
end
|
46
43
|
|
47
44
|
SimpleCov.start do
|
@@ -22,6 +22,11 @@ shared_context 'parsed objects' do
|
|
22
22
|
|
23
23
|
# Include 'dynamic analysis objects' after this context so that this nil will be overridden.
|
24
24
|
let(:runtime_data) { nil }
|
25
|
+
|
26
|
+
let(:project) do
|
27
|
+
require 'transpec/project'
|
28
|
+
Transpec::Project.new
|
29
|
+
end
|
25
30
|
end
|
26
31
|
|
27
32
|
# This context requires `source` to be defined with #let.
|
@@ -49,7 +54,7 @@ end
|
|
49
54
|
shared_context 'syntax object' do |syntax_class, name|
|
50
55
|
let(name) do
|
51
56
|
ast.each_node do |node|
|
52
|
-
syntax = syntax_class.new(node,
|
57
|
+
syntax = syntax_class.new(node, runtime_data, project, source_rewriter)
|
53
58
|
return syntax if syntax.conversion_target?
|
54
59
|
end
|
55
60
|
|
@@ -25,8 +25,8 @@ module Transpec
|
|
25
25
|
[:negative_form_of_to, 'not_to'],
|
26
26
|
[:boolean_matcher_type, :conditional],
|
27
27
|
[:form_of_be_falsey, 'be_falsey'],
|
28
|
+
[:add_explicit_type_metadata_to_example_group?, false],
|
28
29
|
[:add_receiver_arg_to_any_instance_implementation_block?, true],
|
29
|
-
[:add_explicit_type_metadata_to_example_group?, true],
|
30
30
|
[:parenthesize_matcher_arg?, true]
|
31
31
|
].each do |attribute, value|
|
32
32
|
describe "##{attribute}" do
|
@@ -5,11 +5,16 @@ require 'transpec/converter'
|
|
5
5
|
|
6
6
|
module Transpec
|
7
7
|
describe Converter do
|
8
|
-
subject(:converter) { Converter.new(spec_suite,
|
8
|
+
subject(:converter) { Converter.new(spec_suite, project, config) }
|
9
9
|
let(:spec_suite) { double('spec_suite', runtime_data: nil).as_null_object }
|
10
|
+
let(:project) { Project.new }
|
10
11
|
let(:config) { Config.new }
|
11
12
|
let(:rspec_version) { Transpec.required_rspec_version }
|
12
13
|
|
14
|
+
before do
|
15
|
+
converter.stub(:rspec_version).and_return(rspec_version)
|
16
|
+
end
|
17
|
+
|
13
18
|
describe '#convert_file!' do
|
14
19
|
include_context 'isolated environment'
|
15
20
|
|
@@ -481,8 +486,8 @@ module Transpec
|
|
481
486
|
let(:method_stub_object) { double('method_stub_object').as_null_object }
|
482
487
|
|
483
488
|
shared_examples 'invokes MethodStub#allowize!' do
|
484
|
-
it 'invokes MethodStub#allowize!
|
485
|
-
method_stub_object.should_receive(:allowize!)
|
489
|
+
it 'invokes MethodStub#allowize!' do
|
490
|
+
method_stub_object.should_receive(:allowize!)
|
486
491
|
converter.process_method_stub(method_stub_object)
|
487
492
|
end
|
488
493
|
end
|
@@ -1143,8 +1148,8 @@ module Transpec
|
|
1143
1148
|
context 'when Config#convert_deprecated_method? returns true' do
|
1144
1149
|
before { config.convert_deprecated_method = true }
|
1145
1150
|
|
1146
|
-
it 'invokes RSpecConfigure#convert_deprecated_options!
|
1147
|
-
rspec_configure.should_receive(:convert_deprecated_options!)
|
1151
|
+
it 'invokes RSpecConfigure#convert_deprecated_options!' do
|
1152
|
+
rspec_configure.should_receive(:convert_deprecated_options!)
|
1148
1153
|
converter.process_rspec_configure(rspec_configure)
|
1149
1154
|
end
|
1150
1155
|
end
|
@@ -51,9 +51,9 @@ module Transpec
|
|
51
51
|
end
|
52
52
|
|
53
53
|
context 'when command is not specified' do
|
54
|
-
context 'and there is a Gemfile' do
|
54
|
+
context 'and there is a Gemfile.lock' do
|
55
55
|
before do
|
56
|
-
create_file('Gemfile', '')
|
56
|
+
create_file('Gemfile.lock', '')
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'returns "bundle exec rspec"' do
|
@@ -61,7 +61,7 @@ module Transpec
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
context 'and there is no Gemfile' do
|
64
|
+
context 'and there is no Gemfile.lock' do
|
65
65
|
it 'returns "rspec"' do
|
66
66
|
should == 'rspec'
|
67
67
|
end
|
@@ -87,9 +87,9 @@ module Transpec
|
|
87
87
|
end
|
88
88
|
|
89
89
|
context 'when already in copied project directory' do
|
90
|
-
it 'does not
|
90
|
+
it 'does not copy the project again' do
|
91
91
|
DynamicAnalyzer.new(silent: true) do |analyzer|
|
92
|
-
|
92
|
+
DirectoryCloner.should_not_receive(:copy_recursively)
|
93
93
|
analyzer.analyze
|
94
94
|
end
|
95
95
|
end
|
@@ -260,7 +260,7 @@ module Transpec
|
|
260
260
|
gem 'rspec', '~> 2.99'
|
261
261
|
END
|
262
262
|
|
263
|
-
|
263
|
+
Bundler.with_clean_env do
|
264
264
|
`bundle install --path vendor/bundle`
|
265
265
|
end
|
266
266
|
|
data/spec/transpec/git_spec.rb
CHANGED
@@ -91,13 +91,16 @@ module Transpec
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
|
-
describe '.
|
95
|
-
|
94
|
+
describe '.write_commit_message' do
|
95
|
+
let(:message) { 'This is the commit message.' }
|
96
|
+
|
97
|
+
context 'when inside of standard git-dir (.git) repository' do
|
96
98
|
include_context 'inside of git repository'
|
97
99
|
|
98
100
|
context 'and the current working directory is the repository root' do
|
99
|
-
it '
|
100
|
-
Git.
|
101
|
+
it 'writes the message to .git/COMMIT_EDITMSG' do
|
102
|
+
Git.write_commit_message(message)
|
103
|
+
File.read('.git/COMMIT_EDITMSG').should == message
|
101
104
|
end
|
102
105
|
end
|
103
106
|
|
@@ -109,44 +112,30 @@ module Transpec
|
|
109
112
|
end
|
110
113
|
end
|
111
114
|
|
112
|
-
it '
|
113
|
-
Git.
|
115
|
+
it 'writes the message to .git/COMMIT_EDITMSG in the repository root' do
|
116
|
+
Git.write_commit_message(message)
|
117
|
+
File.read('../.git/COMMIT_EDITMSG').should == message
|
114
118
|
end
|
115
119
|
end
|
116
|
-
end
|
117
120
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
+
it 'returns the commit message file path' do
|
122
|
+
path = Git.write_commit_message(message)
|
123
|
+
File.read(path).should == message
|
121
124
|
end
|
122
125
|
end
|
123
|
-
end
|
124
|
-
|
125
|
-
describe '.write_commit_message' do
|
126
|
-
let(:message) { 'This is the commit message.' }
|
127
126
|
|
128
|
-
context 'when inside of git repository' do
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
File.read('.git/COMMIT_EDITMSG').should == message
|
127
|
+
context 'when inside of separated git-dir repository' do
|
128
|
+
around do |example|
|
129
|
+
Dir.mkdir('repo')
|
130
|
+
Dir.chdir('repo') do
|
131
|
+
`git init --separate-git-dir this-is-git-dir`
|
132
|
+
example.run
|
135
133
|
end
|
136
134
|
end
|
137
135
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
Dir.chdir('dir') do
|
142
|
-
example.run
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
it 'writes the message to .git/COMMIT_EDITMSG in repository root directory' do
|
147
|
-
Git.write_commit_message(message)
|
148
|
-
File.read('../.git/COMMIT_EDITMSG').should == message
|
149
|
-
end
|
136
|
+
it 'writes the message to COMMIT_EDITMSG in the separated git-dir' do
|
137
|
+
Git.write_commit_message(message)
|
138
|
+
File.read('this-is-git-dir/COMMIT_EDITMSG').should == message
|
150
139
|
end
|
151
140
|
end
|
152
141
|
|
@@ -163,12 +163,12 @@ module Transpec
|
|
163
163
|
end
|
164
164
|
end
|
165
165
|
|
166
|
-
describe '-
|
167
|
-
let(:args) { ['--
|
166
|
+
describe '-e/--explicit-spec-type option' do
|
167
|
+
let(:args) { ['--explicit-spec-type'] }
|
168
168
|
|
169
|
-
it 'sets Config#add_explicit_type_metadata_to_example_group?
|
169
|
+
it 'sets Config#add_explicit_type_metadata_to_example_group? true' do
|
170
170
|
parser.parse(args)
|
171
|
-
config.add_explicit_type_metadata_to_example_group?.should
|
171
|
+
config.add_explicit_type_metadata_to_example_group?.should be_true
|
172
172
|
end
|
173
173
|
end
|
174
174
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
require 'transpec/project'
|
5
|
+
require 'active_support/core_ext/string/strip.rb'
|
5
6
|
|
6
7
|
module Transpec
|
7
8
|
describe Project do
|
@@ -10,20 +11,130 @@ module Transpec
|
|
10
11
|
|
11
12
|
subject(:project) { Project.new }
|
12
13
|
|
13
|
-
describe '#
|
14
|
+
describe '#using_bundler?' do
|
14
15
|
include_context 'isolated environment'
|
15
16
|
|
16
|
-
subject { project.
|
17
|
+
subject { project.using_bundler? }
|
17
18
|
|
18
|
-
context 'when the project has a Gemfile' do
|
19
|
+
context 'when the project has a Gemfile.lock' do
|
19
20
|
before do
|
20
|
-
create_file('Gemfile', '')
|
21
|
+
create_file('Gemfile.lock', '')
|
21
22
|
end
|
22
23
|
|
23
24
|
it { should be_true }
|
24
25
|
end
|
25
26
|
|
26
|
-
context 'when the project have no Gemfile' do
|
27
|
+
context 'when the project have no Gemfile.lock' do
|
28
|
+
it { should be_false }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe '#depend_on_rspec_rails?' do
|
33
|
+
include_context 'isolated environment'
|
34
|
+
|
35
|
+
subject { project.depend_on_rspec_rails? }
|
36
|
+
|
37
|
+
context 'when the project has a Gemfile.lock' do
|
38
|
+
before do
|
39
|
+
create_file('Gemfile.lock', gemfile_content)
|
40
|
+
end
|
41
|
+
|
42
|
+
context 'and rspec-rails is bundled' do
|
43
|
+
let(:gemfile_content) do
|
44
|
+
<<-END.strip_heredoc
|
45
|
+
GEM
|
46
|
+
remote: https://rubygems.org/
|
47
|
+
specs:
|
48
|
+
actionpack (4.1.7)
|
49
|
+
actionview (= 4.1.7)
|
50
|
+
activesupport (= 4.1.7)
|
51
|
+
rack (~> 1.5.2)
|
52
|
+
rack-test (~> 0.6.2)
|
53
|
+
actionview (4.1.7)
|
54
|
+
activesupport (= 4.1.7)
|
55
|
+
builder (~> 3.1)
|
56
|
+
erubis (~> 2.7.0)
|
57
|
+
activemodel (4.1.7)
|
58
|
+
activesupport (= 4.1.7)
|
59
|
+
builder (~> 3.1)
|
60
|
+
activesupport (4.1.7)
|
61
|
+
i18n (~> 0.6, >= 0.6.9)
|
62
|
+
json (~> 1.7, >= 1.7.7)
|
63
|
+
minitest (~> 5.1)
|
64
|
+
thread_safe (~> 0.1)
|
65
|
+
tzinfo (~> 1.1)
|
66
|
+
builder (3.2.2)
|
67
|
+
diff-lcs (1.2.5)
|
68
|
+
erubis (2.7.0)
|
69
|
+
i18n (0.6.11)
|
70
|
+
json (1.8.1)
|
71
|
+
minitest (5.4.3)
|
72
|
+
rack (1.5.2)
|
73
|
+
rack-test (0.6.2)
|
74
|
+
rack (>= 1.0)
|
75
|
+
railties (4.1.7)
|
76
|
+
actionpack (= 4.1.7)
|
77
|
+
activesupport (= 4.1.7)
|
78
|
+
rake (>= 0.8.7)
|
79
|
+
thor (>= 0.18.1, < 2.0)
|
80
|
+
rake (10.4.0)
|
81
|
+
rspec-core (2.14.8)
|
82
|
+
rspec-expectations (2.14.5)
|
83
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
84
|
+
rspec-mocks (2.14.6)
|
85
|
+
rspec-rails (2.14.2)
|
86
|
+
actionpack (>= 3.0)
|
87
|
+
activemodel (>= 3.0)
|
88
|
+
activesupport (>= 3.0)
|
89
|
+
railties (>= 3.0)
|
90
|
+
rspec-core (~> 2.14.0)
|
91
|
+
rspec-expectations (~> 2.14.0)
|
92
|
+
rspec-mocks (~> 2.14.0)
|
93
|
+
thor (0.19.1)
|
94
|
+
thread_safe (0.3.4)
|
95
|
+
tzinfo (1.2.2)
|
96
|
+
thread_safe (~> 0.1)
|
97
|
+
|
98
|
+
PLATFORMS
|
99
|
+
ruby
|
100
|
+
|
101
|
+
DEPENDENCIES
|
102
|
+
rspec-rails (~> 2.14.0)
|
103
|
+
END
|
104
|
+
end
|
105
|
+
|
106
|
+
it { should be_true }
|
107
|
+
end
|
108
|
+
|
109
|
+
context 'and rspec-rails is not bundled' do
|
110
|
+
let(:gemfile_content) do
|
111
|
+
<<-END.strip_heredoc
|
112
|
+
GEM
|
113
|
+
remote: https://rubygems.org/
|
114
|
+
specs:
|
115
|
+
diff-lcs (1.2.5)
|
116
|
+
rspec (2.14.1)
|
117
|
+
rspec-core (~> 2.14.0)
|
118
|
+
rspec-expectations (~> 2.14.0)
|
119
|
+
rspec-mocks (~> 2.14.0)
|
120
|
+
rspec-core (2.14.8)
|
121
|
+
rspec-expectations (2.14.5)
|
122
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
123
|
+
rspec-mocks (2.14.6)
|
124
|
+
|
125
|
+
PLATFORMS
|
126
|
+
ruby
|
127
|
+
|
128
|
+
DEPENDENCIES
|
129
|
+
rspec (~> 2.14.0)
|
130
|
+
END
|
131
|
+
end
|
132
|
+
|
133
|
+
it { should be_false }
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
context 'when the project have no Gemfile.lock' do
|
27
138
|
it { should be_false }
|
28
139
|
end
|
29
140
|
end
|
@@ -45,7 +156,7 @@ module Transpec
|
|
45
156
|
"gem 'rspec-core', '2.13.0'"
|
46
157
|
])
|
47
158
|
|
48
|
-
|
159
|
+
Bundler.with_clean_env do
|
49
160
|
`bundle install --path vendor/bundle`
|
50
161
|
end
|
51
162
|
end
|
@@ -63,7 +174,7 @@ module Transpec
|
|
63
174
|
context 'when the project has no Gemfile' do
|
64
175
|
include_context 'isolated environment'
|
65
176
|
|
66
|
-
it 'returns version of the RSpec
|
177
|
+
it 'returns version of the RSpec installed in the system' do
|
67
178
|
require 'rspec/core/version'
|
68
179
|
rspec_version.to_s.should == RSpec::Core::Version::STRING
|
69
180
|
end
|