transpec 3.0.0 → 3.0.1
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 +2 -0
- data/CHANGELOG.md +4 -0
- data/lib/transpec/version.rb +1 -1
- data/transpec.gemspec +4 -3
- metadata +3 -97
- data/spec/.rubocop.yml +0 -23
- data/spec/integration/configuration_modification_spec.rb +0 -186
- data/spec/integration/conversion_spec.rb +0 -145
- data/spec/spec_helper.rb +0 -52
- data/spec/support/cache_helper.rb +0 -62
- data/spec/support/file_helper.rb +0 -25
- data/spec/support/shared_context.rb +0 -84
- data/spec/transpec/cli_spec.rb +0 -341
- data/spec/transpec/commit_message_spec.rb +0 -81
- data/spec/transpec/config_spec.rb +0 -99
- data/spec/transpec/converter_spec.rb +0 -1374
- data/spec/transpec/directory_cloner_spec.rb +0 -74
- data/spec/transpec/dynamic_analyzer/rewriter_spec.rb +0 -143
- data/spec/transpec/dynamic_analyzer_spec.rb +0 -329
- data/spec/transpec/git_spec.rb +0 -151
- data/spec/transpec/option_parser_spec.rb +0 -275
- data/spec/transpec/processed_source_spec.rb +0 -93
- data/spec/transpec/project_spec.rb +0 -194
- data/spec/transpec/record_spec.rb +0 -128
- data/spec/transpec/report_spec.rb +0 -126
- data/spec/transpec/rspec_version_spec.rb +0 -129
- data/spec/transpec/spec_file_finder_spec.rb +0 -118
- data/spec/transpec/spec_suite_spec.rb +0 -108
- data/spec/transpec/static_context_inspector_spec.rb +0 -713
- data/spec/transpec/syntax/allow_spec.rb +0 -122
- data/spec/transpec/syntax/be_boolean_spec.rb +0 -176
- data/spec/transpec/syntax/be_close_spec.rb +0 -51
- data/spec/transpec/syntax/current_example_spec.rb +0 -319
- data/spec/transpec/syntax/double_spec.rb +0 -175
- data/spec/transpec/syntax/example_group_spec.rb +0 -716
- data/spec/transpec/syntax/example_spec.rb +0 -301
- data/spec/transpec/syntax/expect_spec.rb +0 -313
- data/spec/transpec/syntax/have_spec.rb +0 -1276
- data/spec/transpec/syntax/hook_spec.rb +0 -215
- data/spec/transpec/syntax/its_spec.rb +0 -448
- data/spec/transpec/syntax/matcher_definition_spec.rb +0 -59
- data/spec/transpec/syntax/method_stub_spec.rb +0 -1301
- data/spec/transpec/syntax/oneliner_should_spec.rb +0 -628
- data/spec/transpec/syntax/operator_spec.rb +0 -871
- data/spec/transpec/syntax/pending_spec.rb +0 -415
- data/spec/transpec/syntax/raise_error_spec.rb +0 -354
- data/spec/transpec/syntax/receive_spec.rb +0 -499
- data/spec/transpec/syntax/rspec_configure_spec.rb +0 -870
- data/spec/transpec/syntax/should_receive_spec.rb +0 -1108
- data/spec/transpec/syntax/should_spec.rb +0 -497
- data/spec/transpec/util_spec.rb +0 -115
- data/spec/transpec_spec.rb +0 -22
data/spec/transpec/util_spec.rb
DELETED
@@ -1,115 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'transpec/util'
|
5
|
-
require 'ast'
|
6
|
-
|
7
|
-
module Transpec
|
8
|
-
describe Util do
|
9
|
-
include_context 'parsed objects'
|
10
|
-
|
11
|
-
describe '#const_name' do
|
12
|
-
subject { Util.const_name(ast) }
|
13
|
-
|
14
|
-
context 'when the passed node is not :const type' do
|
15
|
-
let(:source) { 'foo = 1' }
|
16
|
-
|
17
|
-
it 'returns nil' do
|
18
|
-
should be_nil
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
[
|
23
|
-
['Foo', 'Foo'],
|
24
|
-
['Foo::Bar', 'Foo::Bar'],
|
25
|
-
['Foo::Bar::Baz', 'Foo::Bar::Baz'],
|
26
|
-
['::Foo', 'Foo'],
|
27
|
-
['::Foo::Bar', 'Foo::Bar'],
|
28
|
-
['variable::Foo', 'variable::Foo']
|
29
|
-
].each do |source, expected_return_value|
|
30
|
-
context "when the source is #{source.inspect}" do
|
31
|
-
let(:source) { source }
|
32
|
-
|
33
|
-
it "returns #{expected_return_value.inspect}" do
|
34
|
-
should == expected_return_value
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe '#here_document?' do
|
41
|
-
subject { Util.here_document?(ast) }
|
42
|
-
|
43
|
-
context 'when pseudo-variable __FILE__ node is passed' do
|
44
|
-
let(:source) { '__FILE__' }
|
45
|
-
|
46
|
-
it { should be_false }
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
describe '#each_forward_chained_node' do
|
51
|
-
context 'when a non-send node is passed' do
|
52
|
-
let(:source) { ':foo' }
|
53
|
-
|
54
|
-
it 'does not yield' do
|
55
|
-
yielded = false
|
56
|
-
|
57
|
-
Util.each_forward_chained_node(ast) do
|
58
|
-
yielded = true
|
59
|
-
end
|
60
|
-
|
61
|
-
yielded.should be_false
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
describe '#expand_range_to_adjacent_whitespaces' do
|
67
|
-
let(:node) { ast.each_node.find(&:block_type?) }
|
68
|
-
let(:range) { node.loc.begin }
|
69
|
-
subject(:expanded_range) { Util.expand_range_to_adjacent_whitespaces(range) }
|
70
|
-
|
71
|
-
context 'when the range is adjacent to whitespaces' do
|
72
|
-
let(:source) do
|
73
|
-
<<-END
|
74
|
-
1.times { \t do_something }
|
75
|
-
END
|
76
|
-
end
|
77
|
-
|
78
|
-
it 'returns expanded range that contains adjacent whitespaces' do
|
79
|
-
expanded_range.source.should == " { \t "
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
context 'when the range is not adjacent to whitespaces' do
|
84
|
-
let(:source) do
|
85
|
-
<<-'END'
|
86
|
-
1.times{do_something }
|
87
|
-
END
|
88
|
-
end
|
89
|
-
|
90
|
-
it 'returns un-expanded range' do
|
91
|
-
expanded_range.source.should == '{'
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
describe '#chainable_source' do
|
97
|
-
subject { Util.chainable_source(ast) }
|
98
|
-
|
99
|
-
[
|
100
|
-
['receiver.do_something(arg1, arg2)', 'receiver.do_something(arg1, arg2)'],
|
101
|
-
['receiver.do_something arg1, arg2', 'receiver.do_something(arg1, arg2)'],
|
102
|
-
['receiver[arg1, arg2]', 'receiver[arg1, arg2]'],
|
103
|
-
['receiver + arg', '(receiver + arg)']
|
104
|
-
].each do |original, expected|
|
105
|
-
context "when the invocation is `#{original}` form" do
|
106
|
-
let(:source) { original }
|
107
|
-
|
108
|
-
it "returns `#{expected}`" do
|
109
|
-
should == expected
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
data/spec/transpec_spec.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'transpec'
|
5
|
-
|
6
|
-
module Transpec
|
7
|
-
describe '.root' do
|
8
|
-
it 'returns the path for project root directory' do
|
9
|
-
Dir.chdir(Transpec.root) do
|
10
|
-
File.should exist('Gemfile')
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
describe '.required_rspec_version' do
|
16
|
-
subject { Transpec.required_rspec_version }
|
17
|
-
|
18
|
-
it 'returns an instance of RSpecVersion' do
|
19
|
-
should be_a(RSpecVersion)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|