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.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +11 -0
  3. data/CHANGELOG.md +8 -1
  4. data/Gemfile +0 -2
  5. data/Guardfile +2 -2
  6. data/README.md +16 -16
  7. data/README.md.erb +9 -9
  8. data/lib/transpec/cli.rb +12 -13
  9. data/lib/transpec/config.rb +1 -1
  10. data/lib/transpec/converter.rb +11 -7
  11. data/lib/transpec/dynamic_analyzer.rb +2 -2
  12. data/lib/transpec/git.rb +5 -4
  13. data/lib/transpec/option_parser.rb +8 -8
  14. data/lib/transpec/processed_source.rb +4 -7
  15. data/lib/transpec/project.rb +18 -5
  16. data/lib/transpec/spec_suite.rb +9 -6
  17. data/lib/transpec/syntax.rb +13 -5
  18. data/lib/transpec/syntax/method_stub.rb +1 -1
  19. data/lib/transpec/syntax/mixin/matcher_owner.rb +3 -1
  20. data/lib/transpec/syntax/mixin/owned_matcher.rb +4 -2
  21. data/lib/transpec/syntax/mixin/rspec_rails.rb +1 -1
  22. data/lib/transpec/syntax/oneliner_should.rb +1 -1
  23. data/lib/transpec/syntax/operator.rb +4 -2
  24. data/lib/transpec/syntax/rspec_configure.rb +1 -1
  25. data/lib/transpec/version.rb +3 -3
  26. data/spec/spec_helper.rb +1 -4
  27. data/spec/support/shared_context.rb +6 -1
  28. data/spec/transpec/config_spec.rb +1 -1
  29. data/spec/transpec/converter_spec.rb +10 -5
  30. data/spec/transpec/dynamic_analyzer_spec.rb +6 -6
  31. data/spec/transpec/git_spec.rb +22 -33
  32. data/spec/transpec/option_parser_spec.rb +4 -4
  33. data/spec/transpec/project_spec.rb +118 -7
  34. data/spec/transpec/spec_suite_spec.rb +4 -3
  35. data/spec/transpec/syntax/current_example_spec.rb +2 -2
  36. data/spec/transpec/syntax/double_spec.rb +1 -1
  37. data/spec/transpec/syntax/example_group_spec.rb +309 -164
  38. data/spec/transpec/syntax/example_spec.rb +1 -1
  39. data/spec/transpec/syntax/have_spec.rb +1 -1
  40. data/spec/transpec/syntax/its_spec.rb +1 -1
  41. data/spec/transpec/syntax/method_stub_spec.rb +7 -10
  42. data/spec/transpec/syntax/oneliner_should_spec.rb +1 -1
  43. data/spec/transpec/syntax/pending_spec.rb +1 -1
  44. data/spec/transpec/syntax/rspec_configure_spec.rb +66 -57
  45. data/tasks/readme.rake +12 -3
  46. metadata +3 -3
@@ -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(base_paths = [], runtime_data = nil)
16
- @base_paths = base_paths
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 ||= SpecFileFinder.find(@base_paths).map do |path|
23
- ProcessedSource.from_file(path)
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, nil, runtime_data)
36
+ dispatch_node(node, runtime_data, project)
34
37
  end
35
38
  end
36
39
 
@@ -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
- def dispatch_node(node, source_rewriter = nil, runtime_data = nil, report = nil)
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, source_rewriter, runtime_data, report)
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, :source_rewriter, :runtime_data, :report
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, source_rewriter = nil, runtime_data = nil, report = nil)
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
@@ -57,7 +57,7 @@ module Transpec
57
57
  [:unstub, :unstub!].include?(method_name)
58
58
  end
59
59
 
60
- def allowize!(rspec_version)
60
+ def allowize!
61
61
  return if method_name == :stub_chain && !rspec_version.receive_message_chain_available?
62
62
 
63
63
  unless allow_to_receive_available?
@@ -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(matcher_node, self, source_rewriter, runtime_data, report)
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
- def initialize(node, expectation, source_rewriter = nil, runtime_data = nil, report = nil)
22
- super(node, source_rewriter, runtime_data, report)
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
@@ -18,7 +18,7 @@ module Transpec
18
18
  if runtime_data.present?(node, :rspec_rails?)
19
19
  runtime_data[node, :rspec_rails?]
20
20
  else
21
- true
21
+ project.depend_on_rspec_rails?
22
22
  end
23
23
  end
24
24
  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, source_rewriter, runtime_data)
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(node, expectation, source_rewriter = nil, runtime_data = nil, report = nil)
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, expectation, source_rewriter, runtime_data, report)
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!(rspec_version) # rubocop:disable MethodLength
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=)
@@ -3,9 +3,9 @@
3
3
  module Transpec
4
4
  # http://semver.org/
5
5
  module Version
6
- MAJOR = 2
7
- MINOR = 3
8
- PATCH = 8
6
+ MAJOR = 3
7
+ MINOR = 0
8
+ PATCH = 0
9
9
 
10
10
  def self.to_s
11
11
  [MAJOR, MINOR, PATCH].join('.')
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['CI'] || ENV['COVERAGE']
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, source_rewriter, runtime_data)
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, config, rspec_version) }
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! with RSpecVersion' do
485
- method_stub_object.should_receive(:allowize!).with(rspec_version)
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! with RSpecVersion' do
1147
- rspec_configure.should_receive(:convert_deprecated_options!).with(rspec_version)
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 change working directory' do
90
+ it 'does not copy the project again' do
91
91
  DynamicAnalyzer.new(silent: true) do |analyzer|
92
- Dir.should_not_receive(:chdir)
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
- Project.new.with_bundler_clean_env do
263
+ Bundler.with_clean_env do
264
264
  `bundle install --path vendor/bundle`
265
265
  end
266
266
 
@@ -91,13 +91,16 @@ module Transpec
91
91
  end
92
92
  end
93
93
 
94
- describe '.repository_root' do
95
- context 'when inside of git repository' do
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 'returns the repository root path' do
100
- Git.repository_root.should == File.expand_path('.')
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 'returns the repository root path' do
113
- Git.repository_root.should == File.expand_path('..')
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
- context 'when not inside of git repository' do
119
- it 'raises error' do
120
- -> { Git.repository_root }.should raise_error(/is not a Git repository/)
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
- include_context 'inside of git repository'
130
-
131
- context 'and there is .git directory in the current working directory' do
132
- it 'writes the message to .git/COMMIT_EDITMSG' do
133
- Git.write_commit_message(message)
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
- context 'and there is not .git directory in the current working directory' do
139
- around do |example|
140
- Dir.mkdir('dir')
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 '-t/--no-explicit-spec-type option' do
167
- let(:args) { ['--no-explicit-spec-type'] }
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? false' do
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 be_false
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 '#require_bundler?' do
14
+ describe '#using_bundler?' do
14
15
  include_context 'isolated environment'
15
16
 
16
- subject { project.require_bundler? }
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
- project.with_bundler_clean_env do
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 that is installed in the system' do
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