spectroscope 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby +53 -0
- data/COPYING.rdoc +36 -0
- data/HISTORY.md +10 -0
- data/LICENSE.txt +25 -0
- data/README.md +77 -0
- data/lib/spectroscope.rb +68 -0
- data/lib/spectroscope.yml +53 -0
- data/lib/spectroscope/context.rb +431 -0
- data/lib/spectroscope/example.rb +243 -0
- data/lib/spectroscope/hooks.rb +104 -0
- data/lib/spectroscope/world.rb +7 -0
- data/spec/hooks_spec.rb +83 -0
- data/spec/let_spec.rb +34 -0
- data/spec/scope_spec.rb +15 -0
- data/spec/shared_example_spec.rb +34 -0
- data/spec/subject_spec.rb +26 -0
- metadata +128 -0
data/spec/scope_spec.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require "set"
|
2
|
+
|
3
|
+
shared_examples_for "a collection" do
|
4
|
+
let(:collection) { described_class.new([7, 2, 4]) }
|
5
|
+
|
6
|
+
context "initialized with 3 items" do
|
7
|
+
it "says it has three items" do
|
8
|
+
collection.size.should == 3
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "#include?" do
|
13
|
+
context "with an an item that is in the collection" do
|
14
|
+
it "returns true" do
|
15
|
+
collection.include?(7).should == true
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
context "with an an item that is not in the collection" do
|
20
|
+
it "returns false" do
|
21
|
+
collection.include?(9).should == false
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe Array do
|
28
|
+
it_behaves_like "a collection"
|
29
|
+
end
|
30
|
+
|
31
|
+
describe Set do
|
32
|
+
it_behaves_like "a collection"
|
33
|
+
end
|
34
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
describe "explict subject" do
|
2
|
+
subject { [1,2,3] }
|
3
|
+
|
4
|
+
it "should have the prescribed definition" do
|
5
|
+
subject.should == [1,2,3]
|
6
|
+
end
|
7
|
+
|
8
|
+
describe '#its' do
|
9
|
+
subject { [4,5,6] }
|
10
|
+
|
11
|
+
its(:size){ should == 3 }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe 'implict subject' do
|
16
|
+
|
17
|
+
describe Array do
|
18
|
+
its(:size) { should === 0 }
|
19
|
+
|
20
|
+
it "will be an empty Array" do
|
21
|
+
should.empty?
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
metadata
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: spectroscope
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Trans
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-02-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rubytest
|
16
|
+
requirement: &20217880 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *20217880
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: detroit
|
27
|
+
requirement: &20216480 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *20216480
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: reap
|
38
|
+
requirement: &20215280 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *20215280
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: mast
|
49
|
+
requirement: &20214280 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *20214280
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: ae
|
60
|
+
requirement: &20234400 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *20234400
|
69
|
+
description: Spectroscope is a BDD framework built on RubyTest designed to emulate
|
70
|
+
RSpec in most respects. It is assertion framework independent so any number of assertion
|
71
|
+
systems can be used, such as Assay or AE.
|
72
|
+
email:
|
73
|
+
- transfire@gmail.com
|
74
|
+
executables: []
|
75
|
+
extensions: []
|
76
|
+
extra_rdoc_files:
|
77
|
+
- LICENSE.txt
|
78
|
+
- COPYING.rdoc
|
79
|
+
- HISTORY.md
|
80
|
+
- README.md
|
81
|
+
files:
|
82
|
+
- .ruby
|
83
|
+
- lib/spectroscope/context.rb
|
84
|
+
- lib/spectroscope/example.rb
|
85
|
+
- lib/spectroscope/hooks.rb
|
86
|
+
- lib/spectroscope/world.rb
|
87
|
+
- lib/spectroscope.rb
|
88
|
+
- lib/spectroscope.yml
|
89
|
+
- spec/hooks_spec.rb
|
90
|
+
- spec/let_spec.rb
|
91
|
+
- spec/scope_spec.rb
|
92
|
+
- spec/shared_example_spec.rb
|
93
|
+
- spec/subject_spec.rb
|
94
|
+
- LICENSE.txt
|
95
|
+
- HISTORY.md
|
96
|
+
- README.md
|
97
|
+
- COPYING.rdoc
|
98
|
+
homepage: http://rubyworks.github.com/spectroscope
|
99
|
+
licenses:
|
100
|
+
- BSD-2-Clause
|
101
|
+
post_install_message:
|
102
|
+
rdoc_options: []
|
103
|
+
require_paths:
|
104
|
+
- lib
|
105
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
113
|
+
requirements:
|
114
|
+
- - ! '>='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
requirements: []
|
118
|
+
rubyforge_project:
|
119
|
+
rubygems_version: 1.8.11
|
120
|
+
signing_key:
|
121
|
+
specification_version: 3
|
122
|
+
summary: RSpec-like BDD on RubyTest
|
123
|
+
test_files:
|
124
|
+
- spec/let_spec.rb
|
125
|
+
- spec/hooks_spec.rb
|
126
|
+
- spec/shared_example_spec.rb
|
127
|
+
- spec/subject_spec.rb
|
128
|
+
- spec/scope_spec.rb
|