minispec-given 3.0.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +27 -0
- data/MIT-LICENSE +20 -0
- data/README.md +720 -0
- data/README.old +720 -0
- data/Rakefile +231 -0
- data/TODO +13 -0
- data/doc/main.rdoc +7 -0
- data/examples/example_helper.rb +10 -0
- data/examples/failing/natural_failing_spec.rb +48 -0
- data/examples/failing/sample_spec.rb +7 -0
- data/examples/integration/and_spec.rb +44 -0
- data/examples/integration/failing/eval_subexpression_spec.rb +9 -0
- data/examples/integration/failing/module_nesting_spec.rb +13 -0
- data/examples/integration/failing/undefined_method_spec.rb +9 -0
- data/examples/integration/failing_messages_spec.rb +38 -0
- data/examples/integration/focused_line_spec.rb +9 -0
- data/examples/integration/given_spec.rb +73 -0
- data/examples/integration/invariant_spec.rb +31 -0
- data/examples/integration/then_spec.rb +8 -0
- data/examples/loader.rb +4 -0
- data/examples/minitest_helper.rb +38 -0
- data/examples/other/line_example.rb +9 -0
- data/examples/stack/stack.rb +29 -0
- data/examples/stack/stack_spec.rb +60 -0
- data/examples/stack/stack_spec1.rb +3 -0
- data/lib/given.rb +2 -0
- data/lib/minispec-given.rb +9 -0
- data/lib/minispec/given.rb +1 -0
- data/lib/minitest/given.rb +1 -0
- data/rakelib/bundler_fix.rb +17 -0
- data/rakelib/gemspec.rake +161 -0
- data/rakelib/metrics.rake +30 -0
- data/rakelib/preview.rake +14 -0
- data/test/before_test.rb +22 -0
- data/test/meme_test.rb +36 -0
- metadata +115 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
require './rakelib/bundler_fix'
|
2
|
+
|
3
|
+
METRICS_FILES = FileList['lib/**/*.rb']
|
4
|
+
|
5
|
+
task :check_flog do
|
6
|
+
sh "type flog >/dev/null 2>&1", :verbose => false do |status|
|
7
|
+
fail "Install flog to generate complexity metrics" unless status
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
task :check_flay do
|
12
|
+
sh "type flay >/dev/null 2>&1", :verbose => false do |status|
|
13
|
+
fail "Install flay to generate complexity metrics" unless status
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Run complexity metrics"
|
18
|
+
task :flog, [:all] => :check_flog do |t, args|
|
19
|
+
flags = args.all ? "--all" : ""
|
20
|
+
nobundle do
|
21
|
+
sh "flog #{flags} #{METRICS_FILES}"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "Run duplication metrics"
|
26
|
+
task :flay => :check_flay do
|
27
|
+
nobundle do
|
28
|
+
sh "flay #{METRICS_FILES}"
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require './rakelib/bundler_fix'
|
2
|
+
|
3
|
+
task :check_preview do
|
4
|
+
sh "type ghpreview >/dev/null 2>&1", :verbose => false do |status|
|
5
|
+
fail "Install ghpreview to generate a local REAMDE preview page" unless status
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
desc "Generate the GitHub readme locally"
|
10
|
+
task :preview => :check_preview do
|
11
|
+
nobundle do
|
12
|
+
sh "ghpreview #{FileList['README.*']}"
|
13
|
+
end
|
14
|
+
end
|
data/test/before_test.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require "minitest/autorun"
|
2
|
+
require "minitest/given"
|
3
|
+
|
4
|
+
Given.use_natural_assertions
|
5
|
+
|
6
|
+
describe "Before" do
|
7
|
+
_Gvn_before { puts "Before 1" }
|
8
|
+
def setup
|
9
|
+
puts "Setup 1"
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "not nil" do
|
14
|
+
_Gvn_before { puts "Before 2a" }
|
15
|
+
_Gvn_before { puts "Before 2b" }
|
16
|
+
def setup
|
17
|
+
super
|
18
|
+
puts "Setup 2"
|
19
|
+
end
|
20
|
+
Then { 1 != nil }
|
21
|
+
end
|
22
|
+
end
|
data/test/meme_test.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require "minitest/autorun"
|
2
|
+
require "minitest/given"
|
3
|
+
|
4
|
+
class Meme
|
5
|
+
def will_it_blend?
|
6
|
+
end
|
7
|
+
|
8
|
+
def i_can_has_cheezburger?
|
9
|
+
"OHAI!"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
Given.use_natural_assertions
|
15
|
+
|
16
|
+
describe Meme do
|
17
|
+
def setup
|
18
|
+
super
|
19
|
+
puts "SETUP"
|
20
|
+
end
|
21
|
+
|
22
|
+
Given(:meme) { Meme.new }
|
23
|
+
|
24
|
+
describe "not nil" do
|
25
|
+
def setup
|
26
|
+
super
|
27
|
+
puts "Setup 2"
|
28
|
+
end
|
29
|
+
_Gvn_before { puts "BEFORE" }
|
30
|
+
Then { meme != nil }
|
31
|
+
end
|
32
|
+
|
33
|
+
Then { meme.i_can_has_cheezburger? == "OHAI!" }
|
34
|
+
Then { meme.will_it_blend? !~ /^no/i }
|
35
|
+
Then { skip "test this later" }
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: minispec-given
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.0.beta.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jim Weirich
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-07-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: given_core
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.0.0.beta.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.0.0.beta.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>'
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4.3'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>'
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4.3'
|
41
|
+
description: |
|
42
|
+
Given is a Minitest::Spec extension that allows the use of Given/When/Then
|
43
|
+
terminology when defining specifications.
|
44
|
+
email: jim.weirich@gmail.com
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- Gemfile
|
50
|
+
- Gemfile.lock
|
51
|
+
- MIT-LICENSE
|
52
|
+
- README.md
|
53
|
+
- README.old
|
54
|
+
- Rakefile
|
55
|
+
- TODO
|
56
|
+
- lib/given.rb
|
57
|
+
- lib/minispec-given.rb
|
58
|
+
- lib/minispec/given.rb
|
59
|
+
- lib/minitest/given.rb
|
60
|
+
- rakelib/bundler_fix.rb
|
61
|
+
- rakelib/gemspec.rake
|
62
|
+
- rakelib/metrics.rake
|
63
|
+
- rakelib/preview.rake
|
64
|
+
- test/before_test.rb
|
65
|
+
- test/meme_test.rb
|
66
|
+
- examples/example_helper.rb
|
67
|
+
- examples/failing/natural_failing_spec.rb
|
68
|
+
- examples/failing/sample_spec.rb
|
69
|
+
- examples/integration/and_spec.rb
|
70
|
+
- examples/integration/failing/eval_subexpression_spec.rb
|
71
|
+
- examples/integration/failing/module_nesting_spec.rb
|
72
|
+
- examples/integration/failing/undefined_method_spec.rb
|
73
|
+
- examples/integration/failing_messages_spec.rb
|
74
|
+
- examples/integration/focused_line_spec.rb
|
75
|
+
- examples/integration/given_spec.rb
|
76
|
+
- examples/integration/invariant_spec.rb
|
77
|
+
- examples/integration/then_spec.rb
|
78
|
+
- examples/loader.rb
|
79
|
+
- examples/minitest_helper.rb
|
80
|
+
- examples/other/line_example.rb
|
81
|
+
- examples/stack/stack.rb
|
82
|
+
- examples/stack/stack_spec.rb
|
83
|
+
- examples/stack/stack_spec1.rb
|
84
|
+
- doc/main.rdoc
|
85
|
+
homepage: http://github.com/jimweirich/rspec-given
|
86
|
+
licenses:
|
87
|
+
- MIT
|
88
|
+
metadata: {}
|
89
|
+
post_install_message:
|
90
|
+
rdoc_options:
|
91
|
+
- --line-numbers
|
92
|
+
- --inline-source
|
93
|
+
- --main
|
94
|
+
- doc/main.rdoc
|
95
|
+
- --title
|
96
|
+
- Minitest::Spec Given Extensions
|
97
|
+
require_paths:
|
98
|
+
- lib
|
99
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.9.2
|
104
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - '>'
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: 1.3.1
|
109
|
+
requirements: []
|
110
|
+
rubyforge_project: given
|
111
|
+
rubygems_version: 2.0.3
|
112
|
+
signing_key:
|
113
|
+
specification_version: 4
|
114
|
+
summary: Given/When/Then Specification Extensions for Minispec::Spec.
|
115
|
+
test_files: []
|