forked from marick/Midje
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
133 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
cd ../ | ||
rm downloads/examples.zip | ||
zip -r downloads/examples.zip examples/semi-sweet-examples examples/sweet-examples/basic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'fileutils' | ||
include FileUtils | ||
|
||
standard_tests = %w{examples/semi-sweet-examples examples/sweet-examples/basic} | ||
lein_only_tests = %w{examples/sweet-examples/adder-webapp} | ||
|
||
puts "= Main Tests" | ||
system("ls lib") | ||
system("lein clean") | ||
system("lein test | grep failure") | ||
|
||
standard_tests.each do | dir | | ||
puts("= " + dir) | ||
Dir.chdir(dir) do | ||
system("ls lib") | ||
system("lein clean") | ||
puts " run" | ||
system("run > ~/tmp/run.out; diff ~/tmp/run.out run-expected-output") | ||
puts " lein" | ||
system("lein test > ~/tmp/lein.out; diff ~/tmp/lein.out lein-expected-output") | ||
end | ||
end | ||
|
||
lein_only_tests.each do | dir | | ||
puts("= " + dir) | ||
Dir.chdir(dir) do | ||
system("ls lib") | ||
system("lein clean") | ||
puts " lein" | ||
system("lein test > ~/tmp/lein.out; diff ~/tmp/lein.out lein-expected-output") | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'fileutils' | ||
include FileUtils | ||
|
||
def arg(index, error) | ||
unless ARGV[index] | ||
puts "No #{error} version" | ||
exit 1 | ||
end | ||
ARGV[index] | ||
end | ||
|
||
|
||
$clojure_version = arg(0, "clojure") | ||
$midje_version = arg(1, "midje") | ||
|
||
|
||
$clojure_jar="#{ENV['HOME']}/.m2/repository/org/clojure/clojure/#{$clojure_version}/clojure-#{$clojure_version}.jar" | ||
$contrib_jar="#{ENV['HOME']}/.m2/repository/org/clojure/clojure-contrib/#{$clojure_version}/clojure-contrib-#{$clojure_version}.jar" | ||
$midje_jar="midje-#{$midje_version}.jar" | ||
|
||
def remove_jars(*dirs) | ||
dirs.each do | dir | | ||
`rm -f #{File.join(dir, "lib", "clojure-*")}` | ||
`rm -f #{File.join(dir, "lib", "midje-*")}` | ||
end | ||
end | ||
|
||
def install_jars(*dirs) | ||
dirs.each do | dir | | ||
cp $clojure_jar, File.join(dir, "lib") | ||
cp $contrib_jar, File.join(dir, "lib") | ||
cp $midje_jar, File.join(dir, "lib") | ||
end | ||
end | ||
|
||
remove_jars(".", "examples/semi-sweet-examples", "examples/sweet-examples/adder-webapp", | ||
"examples/sweet-examples/basic") | ||
install_jars(".", "examples/semi-sweet-examples", "examples/sweet-examples/adder-webapp", | ||
"examples/sweet-examples/basic") | ||
|
||
`cd examples/semi-sweet-examples; make-run` | ||
`cd examples/sweet-examples/basic; make-run` | ||
|
||
exit 0 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,26 @@ | ||
[null] Testing semi-sweet-simple.core-test | ||
[null] FAIL at (core_test.clj:25) | ||
[null] expected: 3 | ||
[null] actual: 4 | ||
[null] ^^^^ The previous failure was expected ^^^^ | ||
[null] FAIL at (core_test.clj:30) | ||
[null] Actual result did not pass expected function. | ||
[null] expected function: odd? | ||
[null] actual result: 4 | ||
[null] ^^^^ The previous failure was expected ^^^^ | ||
[null] FAIL at (core_test.clj:40) | ||
[null] Actual result did not pass expected function. | ||
[null] expected function: (exactly odd?) | ||
[null] actual result: #<core$even_QMARK_ clojure.core$even_QMARK_@6a8ef455> | ||
[null] ^^^^ The previous failure was expected ^^^^ | ||
[null] FAIL at (core_test.clj:51) | ||
[null] Actual result did not pass expected function. | ||
[null] expected function: (in-any-order [1 2 3]) | ||
[null] actual result: [3 3 1 2] | ||
[null] ^^^^ The previous failure was expected ^^^^ | ||
[null] FAIL for (core_test.clj:78) | ||
[null] This expectation was never satisfied: | ||
[null] (first-fake 3) should be called at least once. | ||
[null] ^^^^ The previous failure was expected ^^^^ | ||
[null] Ran 11 tests containing 13 assertions. | ||
[null] 5 failures, 0 errors. | ||
[null] -------------------- | ||
[null] Total: | ||
[null] Ran 11 tests containing 13 assertions. | ||
[null] 5 failures, 0 errors. | ||
Testing semi-sweet-simple.core-test | ||
FAIL at (core_test.clj:25) | ||
expected: 3 | ||
actual: 4 | ||
^^^^ The previous failure was expected ^^^^ | ||
FAIL at (core_test.clj:30) | ||
Actual result did not pass expected function. | ||
expected function: odd? | ||
actual result: 4 | ||
^^^^ The previous failure was expected ^^^^ | ||
FAIL at (core_test.clj:40) | ||
Actual result did not pass expected function. | ||
expected function: (exactly odd?) | ||
actual result: #<core$even_QMARK_ clojure.core$even_QMARK_@31ca1a68> | ||
^^^^ The previous failure was expected ^^^^ | ||
FAIL at (core_test.clj:51) | ||
Actual result did not pass expected function. | ||
expected function: (in-any-order [1 2 3]) | ||
actual result: [3 3 1 2] | ||
^^^^ The previous failure was expected ^^^^ | ||
FAIL for (core_test.clj:78) | ||
This expectation was never satisfied: | ||
(first-fake 3) should be called at least once. | ||
^^^^ The previous failure was expected ^^^^ | ||
Ran 11 tests containing 13 assertions. | ||
5 failures, 0 errors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
(defproject semi-sweet-simple "0.5.0" | ||
:description "An example of using Midje semi-sweet mocking" | ||
:dependencies [[org.clojure/clojure "[1.1.0,1.2.0]"] | ||
[org.clojure/clojure-contrib "[1.1.0,1.2.0]"]] | ||
:dev-dependencies [[midje "0.5.0"]] | ||
[org.clojure/clojure-contrib "[1.1.0,1.2.0]"] | ||
[midje "0.5.0"] | ||
] | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FAIL at (core_test.clj:32) | ||
Actual result did not pass expected function. | ||
expected function: truthy | ||
actual result: nil | ||
^^^^ Failure expected. (The test was changed to test the wrong thing.) ^^^^ | ||
FAIL at (core_test.clj:45) | ||
Actual result did not pass expected function. | ||
expected function: (contains regexp) | ||
actual result: "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html lang=\"en\" xml:lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-type\" /><title>adder</title><link href=\"/adder.css\" rel=\"stylesheet\" type=\"text/css\" /></head><body><h2>two numbers added</h2><p class=\"math\">2 + 3 = 5</p><a class=\"action\" href=\"/\">add more numbers</a></body></html>" | ||
^^^^ Failure expected. (The test was changed to test the wrong thing.) ^^^^ | ||
Testing adder.core-test | ||
Ran 0 tests containing 0 assertions. | ||
0 failures, 0 errors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
(defproject basic "0.4.0" | ||
:description "An example of using Midje's sweet interface" | ||
:dependencies [[org.clojure/clojure "[1.1.0,1.2.0]"] | ||
[org.clojure/clojure-contrib "[1.1.0,1.2.0]"]] | ||
:dev-dependencies [[midje "0.5.0"]] | ||
[org.clojure/clojure-contrib "[1.1.0,1.2.0]"] | ||
[midje "0.5.0"]] | ||
) | ||
|