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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -0
  3. data/CHANGELOG.md +4 -0
  4. data/lib/transpec/version.rb +1 -1
  5. data/transpec.gemspec +4 -3
  6. metadata +3 -97
  7. data/spec/.rubocop.yml +0 -23
  8. data/spec/integration/configuration_modification_spec.rb +0 -186
  9. data/spec/integration/conversion_spec.rb +0 -145
  10. data/spec/spec_helper.rb +0 -52
  11. data/spec/support/cache_helper.rb +0 -62
  12. data/spec/support/file_helper.rb +0 -25
  13. data/spec/support/shared_context.rb +0 -84
  14. data/spec/transpec/cli_spec.rb +0 -341
  15. data/spec/transpec/commit_message_spec.rb +0 -81
  16. data/spec/transpec/config_spec.rb +0 -99
  17. data/spec/transpec/converter_spec.rb +0 -1374
  18. data/spec/transpec/directory_cloner_spec.rb +0 -74
  19. data/spec/transpec/dynamic_analyzer/rewriter_spec.rb +0 -143
  20. data/spec/transpec/dynamic_analyzer_spec.rb +0 -329
  21. data/spec/transpec/git_spec.rb +0 -151
  22. data/spec/transpec/option_parser_spec.rb +0 -275
  23. data/spec/transpec/processed_source_spec.rb +0 -93
  24. data/spec/transpec/project_spec.rb +0 -194
  25. data/spec/transpec/record_spec.rb +0 -128
  26. data/spec/transpec/report_spec.rb +0 -126
  27. data/spec/transpec/rspec_version_spec.rb +0 -129
  28. data/spec/transpec/spec_file_finder_spec.rb +0 -118
  29. data/spec/transpec/spec_suite_spec.rb +0 -108
  30. data/spec/transpec/static_context_inspector_spec.rb +0 -713
  31. data/spec/transpec/syntax/allow_spec.rb +0 -122
  32. data/spec/transpec/syntax/be_boolean_spec.rb +0 -176
  33. data/spec/transpec/syntax/be_close_spec.rb +0 -51
  34. data/spec/transpec/syntax/current_example_spec.rb +0 -319
  35. data/spec/transpec/syntax/double_spec.rb +0 -175
  36. data/spec/transpec/syntax/example_group_spec.rb +0 -716
  37. data/spec/transpec/syntax/example_spec.rb +0 -301
  38. data/spec/transpec/syntax/expect_spec.rb +0 -313
  39. data/spec/transpec/syntax/have_spec.rb +0 -1276
  40. data/spec/transpec/syntax/hook_spec.rb +0 -215
  41. data/spec/transpec/syntax/its_spec.rb +0 -448
  42. data/spec/transpec/syntax/matcher_definition_spec.rb +0 -59
  43. data/spec/transpec/syntax/method_stub_spec.rb +0 -1301
  44. data/spec/transpec/syntax/oneliner_should_spec.rb +0 -628
  45. data/spec/transpec/syntax/operator_spec.rb +0 -871
  46. data/spec/transpec/syntax/pending_spec.rb +0 -415
  47. data/spec/transpec/syntax/raise_error_spec.rb +0 -354
  48. data/spec/transpec/syntax/receive_spec.rb +0 -499
  49. data/spec/transpec/syntax/rspec_configure_spec.rb +0 -870
  50. data/spec/transpec/syntax/should_receive_spec.rb +0 -1108
  51. data/spec/transpec/syntax/should_spec.rb +0 -497
  52. data/spec/transpec/util_spec.rb +0 -115
  53. data/spec/transpec_spec.rb +0 -22
@@ -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
@@ -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