riot 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@ When you're done reading here, take a gander at:
9
9
 
10
10
  #### Installation
11
11
 
12
- The Riot gem is hosted on gemcutter.org. It used to be hosted on GitHub, but they turned of gem support while moving to Rackspace, so we moved to gemcutter. If you have not already done so, add gemcutter.org to your list of gem sources like so:
12
+ The Riot gem is hosted on gemcutter.org. It used to be hosted on GitHub, but they turned off gem support while moving to Rackspace, so we moved to gemcutter. If you have not already done so, add gemcutter.org to your list of gem sources like so:
13
13
 
14
14
  sudo gem sources -a http://gemcutter.org
15
15
 
@@ -100,6 +100,16 @@ This is awfully redundant - not to mention, contrived. So, we wrote a shortcut t
100
100
  asserts_topic.kind_of(Billionaire)
101
101
  end
102
102
 
103
+ If you'd like to add a description to your assertion about the topic,
104
+ but still would like to avoid the redundancy of an assertion simply
105
+ returning the topic from it's block, you can omit the block all
106
+ together as follows:
107
+
108
+ context "a trazillionaire" do
109
+ setup { MoneyMaker.build(:trazillionaire) }
110
+ asserts("is a trazillionaire").kind_of(Trazillionaire)
111
+ end
112
+
103
113
  #### Example: Equality
104
114
 
105
115
  One of the most common assertions you will (or do already) utilize is that of equality; is this equal to that? Riot supports this in a slightly different manner than most other frameworks. With Riot, you add the expectation to the assertion itself.
data/Rakefile CHANGED
@@ -47,6 +47,7 @@ begin
47
47
  gem.email = "gus@gusg.us"
48
48
  gem.homepage = "http://github.com/thumblemonks/riot"
49
49
  gem.authors = ["Justin 'Gus' Knowlden"]
50
+ gem.add_dependency 'colorize'
50
51
  end
51
52
  Jeweler::GemcutterTasks.new
52
53
  rescue LoadError
File without changes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.10.0
1
+ 0.10.1
@@ -1,7 +1,7 @@
1
1
  module Riot
2
2
  class RunnableBlock
3
3
  def initialize(description, &definition)
4
- @description, @definition = description, definition
4
+ @description, @definition = description, definition || Proc.new { topic }
5
5
  end
6
6
 
7
7
  def to_s
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{riot}
8
- s.version = "0.10.0"
8
+ s.version = "0.10.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin 'Gus' Knowlden"]
12
- s.date = %q{2009-11-21}
12
+ s.date = %q{2009-11-23}
13
13
  s.description = %q{An extremely fast, expressive, and context-driven unit-testing framework. A replacement for all other testing frameworks. Protest the slow test.}
14
14
  s.email = %q{gus@gusg.us}
15
15
  s.extra_rdoc_files = [
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
  "MIT-LICENSE",
21
21
  "README.markdown",
22
22
  "Rakefile",
23
+ "TODO.markdown",
23
24
  "VERSION",
24
25
  "lib/riot.rb",
25
26
  "lib/riot/assertion_macros.rb",
@@ -78,9 +79,12 @@ Gem::Specification.new do |s|
78
79
  s.specification_version = 3
79
80
 
80
81
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
82
+ s.add_runtime_dependency(%q<colorize>, [">= 0"])
81
83
  else
84
+ s.add_dependency(%q<colorize>, [">= 0"])
82
85
  end
83
86
  else
87
+ s.add_dependency(%q<colorize>, [">= 0"])
84
88
  end
85
89
  end
86
90
 
@@ -1,6 +1,6 @@
1
1
  require 'teststrap'
2
2
 
3
- context "An assertion block" do
3
+ context "An assertion" do
4
4
  context "that is passing" do
5
5
  setup { Riot::Assertion.new("foo") { true } }
6
6
  asserts("to_s") { topic.to_s == "foo" }
@@ -31,4 +31,16 @@ context "An assertion block" do
31
31
  topic.run(Riot::Situation.new) == [:error, @exception]
32
32
  end
33
33
  end # that is erroring
34
+
35
+ context "with no block" do
36
+ setup do
37
+ @situation = Riot::Situation.new
38
+ @situation.topic = "hello"
39
+ Riot::Assertion.new("test")
40
+ end
41
+ should("use block returning topic as default") do
42
+ topic.equals("hello")
43
+ result = topic.run(@situation)
44
+ end.equals([:pass])
45
+ end
34
46
  end # An assertion block
@@ -1,4 +1,4 @@
1
- $: << File.join(File.dirname(__FILE__), "..", "lib")
1
+ $:.unshift(File.dirname(__FILE__)+"/../lib/")
2
2
  require 'riot'
3
3
 
4
4
  module Riot
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin 'Gus' Knowlden
@@ -9,10 +9,19 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-21 00:00:00 -06:00
12
+ date: 2009-11-23 00:00:00 -06:00
13
13
  default_executable:
14
- dependencies: []
15
-
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: colorize
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
16
25
  description: An extremely fast, expressive, and context-driven unit-testing framework. A replacement for all other testing frameworks. Protest the slow test.
17
26
  email: gus@gusg.us
18
27
  executables: []
@@ -26,6 +35,7 @@ files:
26
35
  - MIT-LICENSE
27
36
  - README.markdown
28
37
  - Rakefile
38
+ - TODO.markdown
29
39
  - VERSION
30
40
  - lib/riot.rb
31
41
  - lib/riot/assertion_macros.rb