Skip to content

Commit 477aa84

Browse files
committed
Test improvements
Based on feedback from people who are extending the buildpack, the repetitiveness of the buildpack testing was problematic. The goals of this change were to drastically reduce the amount of test code written and make the code that was written more understandable. These goals were accomplished with a variety of strategies, but the two biggest were the use of example metadata and shared contexts. The example metadata allows us to declaratively describe things like which application fixture to use for the test, while the shared contexts allow us to encapsulate and reuse common test behaviors. [#59911894]
1 parent fd3ba6f commit 477aa84

67 files changed

Lines changed: 2513 additions & 2911 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/dictionaries/bhale.xml

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/All_Tests.xml

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gemfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ end
99

1010
group :development, :test do
1111
gem 'webmock'
12-
gem 'rspec'
12+
gem 'rspec', '>= 3.0.0.beta'
1313
gem 'simplecov'
1414
end
1515

1616
group :test do
1717
gem 'codeclimate-test-reporter'
1818
end
19+
20+
group :debug do
21+
gem 'ruby-debug-base19x', '>= 0.11.30.pre'
22+
gem 'ruby-debug-ide'
23+
end

Gemfile.lock

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ GEM
33
specs:
44
addressable (2.3.5)
55
ast (1.1.0)
6-
codeclimate-test-reporter (0.1.1)
6+
codeclimate-test-reporter (0.2.0)
77
simplecov (>= 0.7.1, < 1.0.0)
88
crack (0.4.1)
99
safe_yaml (~> 0.9.0)
10-
diff-lcs (1.2.4)
10+
debugger-ruby_core_source (1.2.3)
11+
diff-lcs (1.2.5)
12+
docile (1.1.0)
1113
multi_json (1.8.2)
1214
parser (2.0.0)
1315
ast (~> 1.1)
@@ -16,25 +18,35 @@ GEM
1618
rainbow (1.1.4)
1719
rake (10.1.0)
1820
redcarpet (3.0.0)
19-
rspec (2.14.1)
20-
rspec-core (~> 2.14.0)
21-
rspec-expectations (~> 2.14.0)
22-
rspec-mocks (~> 2.14.0)
23-
rspec-core (2.14.7)
24-
rspec-expectations (2.14.4)
21+
rspec (3.0.0.beta1)
22+
rspec-core (= 3.0.0.beta1)
23+
rspec-expectations (= 3.0.0.beta1)
24+
rspec-mocks (= 3.0.0.beta1)
25+
rspec-core (3.0.0.beta1)
26+
rspec-support (= 3.0.0.beta1)
27+
rspec-expectations (3.0.0.beta1)
2528
diff-lcs (>= 1.1.3, < 2.0)
26-
rspec-mocks (2.14.4)
29+
rspec-support (= 3.0.0.beta1)
30+
rspec-mocks (3.0.0.beta1)
31+
rspec-support (= 3.0.0.beta1)
32+
rspec-support (3.0.0.beta1)
2733
rubocop (0.15.0)
2834
parser (~> 2.0)
2935
powerpack (~> 0.0.6)
3036
rainbow (>= 1.1.4)
37+
ruby-debug-base19x (0.11.30.pre15)
38+
debugger-ruby_core_source (> 0)
39+
rake (>= 0.8.1)
40+
ruby-debug-ide (0.4.22)
41+
rake (>= 0.8.1)
3142
safe_yaml (0.9.7)
32-
simplecov (0.7.1)
33-
multi_json (~> 1.0)
34-
simplecov-html (~> 0.7.1)
35-
simplecov-html (0.7.1)
36-
slop (3.4.6)
37-
webmock (1.15.2)
43+
simplecov (0.8.2)
44+
docile (~> 1.1.0)
45+
multi_json
46+
simplecov-html (~> 0.8.0)
47+
simplecov-html (0.8.0)
48+
slop (3.4.7)
49+
webmock (1.16.0)
3850
addressable (>= 2.2.7)
3951
crack (>= 0.3.2)
4052
yard (0.8.7.3)
@@ -46,8 +58,10 @@ DEPENDENCIES
4658
codeclimate-test-reporter
4759
rake
4860
redcarpet
49-
rspec
61+
rspec (>= 3.0.0.beta)
5062
rubocop
63+
ruby-debug-base19x (>= 0.11.30.pre)
64+
ruby-debug-ide
5165
simplecov
5266
webmock
5367
yard

Gemfile.rubymine-debug

Lines changed: 0 additions & 9 deletions
This file was deleted.

Gemfile.rubymine-debug.lock

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ bundle install
5555
bundle exec rake
5656
```
5757

58-
If you want to use the RubyMine debugger, you may need to [install additional gems][] by issuing:
59-
60-
```bash
61-
bundle install --gemfile Gemfile.rubymine-debug
62-
```
63-
6458
[Installing Cloud Foundry on Vagrant][] is useful for privately testing new features.
6559

6660
## Contributing
@@ -73,7 +67,6 @@ This buildpack is released under version 2.0 of the [Apache License][].
7367
[Cloud Foundry]: http://www.cloudfoundry.com
7468
[contributor guidelines]: CONTRIBUTING.md
7569
[GitHub's forking functionality]: https://help.github.com/articles/fork-a-repo
76-
[install additional gems]: http://stackoverflow.com/questions/11732715/how-do-i-install-ruby-debug-base19x-on-mountain-lion-for-intellij
7770
[pull request]: https://help.github.com/articles/using-pull-requests
7871
[Pull requests]: http://help.github.com/send-pull-requests
7972
[Installing Cloud Foundry on Vagrant]: http://blog.cloudfoundry.com/2013/06/27/installing-cloud-foundry-on-vagrant/

java-buildpack.iml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<module type="RUBY_MODULE" version="4">
3-
<component name="NewModuleRootManager">
3+
<component name="NewModuleRootManager" inherit-compiler-output="false">
44
<content url="file://$MODULE_DIR$">
55
<sourceFolder url="file://$MODULE_DIR$/lib/java_buildpack" isTestSource="false" />
66
<sourceFolder url="file://$MODULE_DIR$/bin" isTestSource="false" />
@@ -16,29 +16,34 @@
1616
<orderEntry type="library" scope="PROVIDED" name="addressable (v2.3.5, rbenv: 1.9.3-p448) [gem]" level="application" />
1717
<orderEntry type="library" scope="PROVIDED" name="ast (v1.1.0, rbenv: 1.9.3-p448) [gem]" level="application" />
1818
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.3.5, rbenv: 1.9.3-p448) [gem]" level="application" />
19-
<orderEntry type="library" scope="PROVIDED" name="codeclimate-test-reporter (v0.1.1, rbenv: 1.9.3-p448) [gem]" level="application" />
19+
<orderEntry type="library" scope="PROVIDED" name="codeclimate-test-reporter (v0.2.0, rbenv: 1.9.3-p448) [gem]" level="application" />
2020
<orderEntry type="library" scope="PROVIDED" name="crack (v0.4.1, rbenv: 1.9.3-p448) [gem]" level="application" />
21-
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.4, rbenv: 1.9.3-p448) [gem]" level="application" />
21+
<orderEntry type="library" scope="PROVIDED" name="debugger-ruby_core_source (v1.2.3, rbenv: 1.9.3-p448) [gem]" level="application" />
22+
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.5, rbenv: 1.9.3-p448) [gem]" level="application" />
23+
<orderEntry type="library" scope="PROVIDED" name="docile (v1.1.0, rbenv: 1.9.3-p448) [gem]" level="application" />
2224
<orderEntry type="library" scope="PROVIDED" name="multi_json (v1.8.2, rbenv: 1.9.3-p448) [gem]" level="application" />
2325
<orderEntry type="library" scope="PROVIDED" name="parser (v2.0.0, rbenv: 1.9.3-p448) [gem]" level="application" />
2426
<orderEntry type="library" scope="PROVIDED" name="powerpack (v0.0.9, rbenv: 1.9.3-p448) [gem]" level="application" />
2527
<orderEntry type="library" scope="PROVIDED" name="rainbow (v1.1.4, rbenv: 1.9.3-p448) [gem]" level="application" />
2628
<orderEntry type="library" scope="PROVIDED" name="rake (v10.1.0, rbenv: 1.9.3-p448) [gem]" level="application" />
2729
<orderEntry type="library" scope="PROVIDED" name="redcarpet (v3.0.0, rbenv: 1.9.3-p448) [gem]" level="application" />
28-
<orderEntry type="library" scope="PROVIDED" name="rspec (v2.14.1, rbenv: 1.9.3-p448) [gem]" level="application" />
29-
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v2.14.7, rbenv: 1.9.3-p448) [gem]" level="application" />
30-
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v2.14.4, rbenv: 1.9.3-p448) [gem]" level="application" />
31-
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v2.14.4, rbenv: 1.9.3-p448) [gem]" level="application" />
30+
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.0.0.beta1, rbenv: 1.9.3-p448) [gem]" level="application" />
31+
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.0.0.beta1, rbenv: 1.9.3-p448) [gem]" level="application" />
32+
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.0.0.beta1, rbenv: 1.9.3-p448) [gem]" level="application" />
33+
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.0.0.beta1, rbenv: 1.9.3-p448) [gem]" level="application" />
34+
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.0.0.beta1, rbenv: 1.9.3-p448) [gem]" level="application" />
3235
<orderEntry type="library" scope="PROVIDED" name="rubocop (v0.15.0, rbenv: 1.9.3-p448) [gem]" level="application" />
36+
<orderEntry type="library" scope="PROVIDED" name="ruby-debug-base19x (v0.11.30.pre15, rbenv: 1.9.3-p448) [gem]" level="application" />
37+
<orderEntry type="library" scope="PROVIDED" name="ruby-debug-ide (v0.4.22, rbenv: 1.9.3-p448) [gem]" level="application" />
3338
<orderEntry type="library" scope="PROVIDED" name="safe_yaml (v0.9.7, rbenv: 1.9.3-p448) [gem]" level="application" />
34-
<orderEntry type="library" scope="PROVIDED" name="simplecov (v0.7.1, rbenv: 1.9.3-p448) [gem]" level="application" />
35-
<orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.7.1, rbenv: 1.9.3-p448) [gem]" level="application" />
36-
<orderEntry type="library" scope="PROVIDED" name="slop (v3.4.6, rbenv: 1.9.3-p448) [gem]" level="application" />
37-
<orderEntry type="library" scope="PROVIDED" name="webmock (v1.15.2, rbenv: 1.9.3-p448) [gem]" level="application" />
39+
<orderEntry type="library" scope="PROVIDED" name="simplecov (v0.8.2, rbenv: 1.9.3-p448) [gem]" level="application" />
40+
<orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.8.0, rbenv: 1.9.3-p448) [gem]" level="application" />
41+
<orderEntry type="library" scope="PROVIDED" name="slop (v3.4.7, rbenv: 1.9.3-p448) [gem]" level="application" />
42+
<orderEntry type="library" scope="PROVIDED" name="webmock (v1.16.0, rbenv: 1.9.3-p448) [gem]" level="application" />
3843
<orderEntry type="library" scope="PROVIDED" name="yard (v0.8.7.3, rbenv: 1.9.3-p448) [gem]" level="application" />
3944
</component>
4045
<component name="RModuleSettingsStorage">
41-
<LOAD_PATH number="1" string0="$MODULE_DIR$/lib" />
46+
<LOAD_PATH number="2" string0="$MODULE_DIR$/lib" string1="$MODULE_DIR$/spec" />
4247
<I18N_FOLDERS number="0" />
4348
</component>
4449
</module>

lib/java_buildpack/framework/play_jpa_plugin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def supports?
5353
PLAY_JPA_PLUGIN_JAR = '*play-java-jpa*.jar'.freeze
5454

5555
def jar_name
56-
"#{id @version}.jar"
56+
"#{@parsable_component_name}-#{@version}.jar"
5757
end
5858

5959
def play20?(play_version)

0 commit comments

Comments
 (0)