physh_roller 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +7 -0
- data/README +1 -0
- data/bin/dice +42 -0
- data/doc/Object.html +204 -0
- data/doc/Output.html +226 -0
- data/doc/PhyshRoller.html +140 -0
- data/doc/PhyshRoller/DiceRoll.html +498 -0
- data/doc/PhyshRoller/Die.html +266 -0
- data/doc/created.rid +14 -0
- data/doc/doc/created_rid.html +97 -0
- data/doc/features/physh_roller/parse_dice_roll_string_feature.html +117 -0
- data/doc/features/physh_roller/roll_dice_feature.html +119 -0
- data/doc/features/physh_roller/roll_die_feature.html +117 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +94 -0
- data/doc/js/darkfish.js +155 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +595 -0
- data/doc/table_of_contents.html +98 -0
- data/features/physh_roller/parse_dice_roll_string.feature +19 -0
- data/features/physh_roller/roll_dice.feature +22 -0
- data/features/physh_roller/roll_die.feature +19 -0
- data/features/step_definitions/physh_roller/physh_roller_steps.rb +79 -0
- data/features/support/env.rb +3 -0
- data/lib/physh_roller.rb +2 -0
- data/lib/physh_roller/dice_roll.rb +62 -0
- data/lib/physh_roller/die.rb +14 -0
- data/spec/physh_roller/dice_roll_spec.rb +145 -0
- data/spec/physh_roller/die_spec.rb +44 -0
- data/spec/spec_helper.rb +3 -0
- metadata +133 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module PhyshRoller
|
4
|
+
describe Die do
|
5
|
+
describe "attributes" do
|
6
|
+
subject { Die.new(8) }
|
7
|
+
|
8
|
+
it { should respond_to(:sides_on_die) }
|
9
|
+
its(:sides_on_die) { should be_a_kind_of(::Integer) }
|
10
|
+
it { should respond_to(:last_result) }
|
11
|
+
its(:last_result) { should be_a_kind_of(::Integer) }
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#new" do
|
15
|
+
context "with a 1000 sided die" do
|
16
|
+
subject { Die.new(1000) }
|
17
|
+
|
18
|
+
its(:sides_on_die) { should == 1000 }
|
19
|
+
its(:last_result) { should == 0 }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe "#roll" do
|
24
|
+
context "starting with a new die with 100 sides" do
|
25
|
+
before(:all) { @die = Die.new(100) }
|
26
|
+
it ":last_result is 0" do
|
27
|
+
@die.last_result.should == 0
|
28
|
+
end
|
29
|
+
|
30
|
+
it "#roll changes the :last_result from the default of 0" do
|
31
|
+
expect{@die.roll}.to change{@die.last_result}.by_at_least(1)
|
32
|
+
end
|
33
|
+
|
34
|
+
describe ":last_result" do
|
35
|
+
subject { @die.last_result }
|
36
|
+
|
37
|
+
it { should be > 0 }
|
38
|
+
it { should be <= @die.sides_on_die }
|
39
|
+
it { should be_a_kind_of(::Integer) }
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: physh_roller
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kryptyk Fysh
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-03-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: cucumber
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: A simple dice rolling application.
|
42
|
+
email: kryptykfysh@kryptykfysh.co.uk
|
43
|
+
executables:
|
44
|
+
- dice
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- bin/dice
|
49
|
+
- lib/physh_roller.rb
|
50
|
+
- lib/physh_roller/dice_roll.rb
|
51
|
+
- lib/physh_roller/die.rb
|
52
|
+
- spec/spec_helper.rb
|
53
|
+
- spec/physh_roller/dice_roll_spec.rb
|
54
|
+
- spec/physh_roller/die_spec.rb
|
55
|
+
- doc/rdoc.css
|
56
|
+
- doc/doc/created_rid.html
|
57
|
+
- doc/PhyshRoller.html
|
58
|
+
- doc/images/tag_blue.png
|
59
|
+
- doc/images/plugin.png
|
60
|
+
- doc/images/wrench_orange.png
|
61
|
+
- doc/images/bullet_toggle_plus.png
|
62
|
+
- doc/images/transparent.png
|
63
|
+
- doc/images/find.png
|
64
|
+
- doc/images/macFFBgHack.png
|
65
|
+
- doc/images/bullet_black.png
|
66
|
+
- doc/images/page_white_text.png
|
67
|
+
- doc/images/loadingAnimation.gif
|
68
|
+
- doc/images/ruby.png
|
69
|
+
- doc/images/zoom.png
|
70
|
+
- doc/images/brick.png
|
71
|
+
- doc/images/bullet_toggle_minus.png
|
72
|
+
- doc/images/wrench.png
|
73
|
+
- doc/images/page_green.png
|
74
|
+
- doc/images/add.png
|
75
|
+
- doc/images/tag_green.png
|
76
|
+
- doc/images/brick_link.png
|
77
|
+
- doc/images/package.png
|
78
|
+
- doc/images/bug.png
|
79
|
+
- doc/images/delete.png
|
80
|
+
- doc/images/date.png
|
81
|
+
- doc/images/page_white_width.png
|
82
|
+
- doc/images/arrow_up.png
|
83
|
+
- doc/table_of_contents.html
|
84
|
+
- doc/PhyshRoller/DiceRoll.html
|
85
|
+
- doc/PhyshRoller/Die.html
|
86
|
+
- doc/features/physh_roller/roll_dice_feature.html
|
87
|
+
- doc/features/physh_roller/parse_dice_roll_string_feature.html
|
88
|
+
- doc/features/physh_roller/roll_die_feature.html
|
89
|
+
- doc/Output.html
|
90
|
+
- doc/Object.html
|
91
|
+
- doc/js/searcher.js
|
92
|
+
- doc/js/darkfish.js
|
93
|
+
- doc/js/search.js
|
94
|
+
- doc/js/navigation.js
|
95
|
+
- doc/js/search_index.js
|
96
|
+
- doc/js/jquery.js
|
97
|
+
- doc/index.html
|
98
|
+
- doc/created.rid
|
99
|
+
- features/step_definitions/physh_roller/physh_roller_steps.rb
|
100
|
+
- features/support/env.rb
|
101
|
+
- features/physh_roller/roll_dice.feature
|
102
|
+
- features/physh_roller/roll_die.feature
|
103
|
+
- features/physh_roller/parse_dice_roll_string.feature
|
104
|
+
- LICENSE
|
105
|
+
- README
|
106
|
+
homepage: https://github.com/kryptykfysh/PhyshRoller
|
107
|
+
licenses:
|
108
|
+
- MIT
|
109
|
+
metadata: {}
|
110
|
+
post_install_message:
|
111
|
+
rdoc_options: []
|
112
|
+
require_paths:
|
113
|
+
- lib
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '1.9'
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - '>='
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
requirements: []
|
125
|
+
rubyforge_project:
|
126
|
+
rubygems_version: 2.0.0.rc.2
|
127
|
+
signing_key:
|
128
|
+
specification_version: 4
|
129
|
+
summary: A dice rolling application
|
130
|
+
test_files:
|
131
|
+
- spec/spec_helper.rb
|
132
|
+
- spec/physh_roller/dice_roll_spec.rb
|
133
|
+
- spec/physh_roller/die_spec.rb
|