role_playing 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67d173ab2c3f235941e351907e610a2e2c3e0934
4
- data.tar.gz: 268fd50337dfda5a7c02a6d7817a2d48942030c6
3
+ metadata.gz: cc74978c9985f1142bd3444a4d139e704140e54d
4
+ data.tar.gz: f885fb34c5abb5a854cc7b5c8ce06a02901b77bd
5
5
  SHA512:
6
- metadata.gz: 24cb7c2d17cd30a1e6271db07fd249b0fbf26e3772be634b2307552b3c27c28d9b6aa0de3ffc7c07ea837a9c50022b4253338be53e7ce4550fa4f935928b9cb9
7
- data.tar.gz: 9c1e73cd45f4944e4a8884b8aea53cb81b46584e303f339425042fc386cf9aad6be25c83c4f71705a53c7a9af090da9f9d546efb386ae2b00480cf66d8987e6c
6
+ metadata.gz: 8ab1fef9d6becafeba82880bac4cc200dfb76e8365dedc5d7546b7dea8a710301f43bf4210c82843013719f6211dd221e8053c073226d420f376a8b9de387a10
7
+ data.tar.gz: 53cf26da5412beb79b391c0ac2fb4ab3aed8e830354a5f5689b394c429549c8a48ba9622a8a60971a3d9a6b55f12a6e5ba59da491721805a58e4fbfefe126a9b
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -1,6 +1,7 @@
1
+ require "active_support"
1
2
  require "active_support/core_ext"
2
3
  require "role_playing/version"
3
4
  require "role_playing/core_ext"
4
5
  require "role_playing/context"
5
6
  require "role_playing/role"
6
- require 'role_playing/railtie' if defined?(Rails)
7
+ require 'role_playing/railtie' if defined?(Rails)
@@ -1,3 +1,3 @@
1
1
  module RolePlaying
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
- gem.add_development_dependency("rspec", ">= 2.12.0")
20
+ gem.add_development_dependency("rspec", ">= 3.0")
21
21
  gem.add_development_dependency("bundler")
22
22
 
23
23
  gem.add_dependency("activesupport", ">= 3.0.0")
@@ -59,30 +59,30 @@ describe RolePlaying do
59
59
  subject { MyRole.new(bare_object) }
60
60
 
61
61
  it "should be of same class as wrapped object" do
62
- subject.class.should == bare_object.class
62
+ expect(subject.class).to eq bare_object.class
63
63
  end
64
64
 
65
65
  it "should be equal to wrapped object" do
66
- subject.should == bare_object
66
+ expect(subject).to eq bare_object
67
67
  end
68
68
 
69
69
  it "should respond_to additional methods" do
70
- subject.should respond_to(:two_fields)
70
+ expect(subject).to respond_to(:two_fields)
71
71
  end
72
72
 
73
73
  it "#two_fields should concatenate data objects two fields" do
74
- subject.two_fields.should == "#{bare_object.field_1} #{bare_object.field_2}"
74
+ expect(subject.two_fields).to eq "#{bare_object.field_1} #{bare_object.field_2}"
75
75
  end
76
76
 
77
77
  it "#role_player should not respond_to additional methods" do
78
- subject.role_player.should_not respond_to(:two_fields)
78
+ expect(subject.role_player).to_not respond_to(:two_fields)
79
79
  end
80
80
 
81
81
  it "#in_role takes a block and returns the result" do
82
82
  two_fields = MyRole.played_by(bare_object) do |role|
83
83
  role.two_fields
84
84
  end
85
- two_fields.should == "#{bare_object.field_1} #{bare_object.field_2}"
85
+ expect(two_fields).to eq "#{bare_object.field_1} #{bare_object.field_2}"
86
86
  end
87
87
 
88
88
  end
@@ -109,9 +109,9 @@ describe RolePlaying do
109
109
 
110
110
  it "an array of roles can be applied using Array#played_by" do
111
111
  role = [role_class_1, role_class_2].played_by(player_class.new)
112
- role.should respond_to(:role_1)
113
- role.should respond_to(:role_2)
114
- role.should respond_to(:base)
112
+ expect(role).to respond_to(:role_1)
113
+ expect(role).to respond_to(:role_2)
114
+ expect(role).to respond_to(:base)
115
115
  end
116
116
  end
117
117
 
@@ -122,13 +122,13 @@ describe RolePlaying do
122
122
  let(:bare_account) {Account.new(original_amount)}
123
123
  subject { MoneyTransferring::SourceAccount.new(bare_account) }
124
124
  it "adds a withdraw method to data object" do
125
- bare_account.should_not respond_to(:withdraw)
126
- subject.should respond_to(:withdraw)
125
+ expect(bare_account).to_not respond_to(:withdraw)
126
+ expect(subject).to respond_to(:withdraw)
127
127
  end
128
128
  it "withdraws a specified amount" do
129
129
  subject.withdraw(10)
130
- subject.amount.should == original_amount-10
131
- bare_account.amount.should == original_amount-10
130
+ expect(subject.amount).to eq original_amount-10
131
+ expect(bare_account.amount).to eq original_amount-10
132
132
  end
133
133
  end
134
134
 
@@ -137,13 +137,13 @@ describe RolePlaying do
137
137
  let(:bare_account) {Account.new(original_amount)}
138
138
  subject { MoneyTransferring::DestinationAccount.new(bare_account) }
139
139
  it "adds a deposit method to data object" do
140
- bare_account.should_not respond_to(:deposit)
141
- subject.should respond_to(:deposit)
140
+ expect(bare_account).to_not respond_to(:deposit)
141
+ expect(subject).to respond_to(:deposit)
142
142
  end
143
143
  it "deposits a specified amount" do
144
144
  subject.deposit(10)
145
- subject.amount.should == original_amount+10
146
- bare_account.amount.should == original_amount+10
145
+ expect(subject.amount).to eq original_amount+10
146
+ expect(bare_account.amount).to eq original_amount+10
147
147
  end
148
148
  end
149
149
 
@@ -155,11 +155,11 @@ describe RolePlaying do
155
155
  subject { MoneyTransferring.new(source_account, destination_account) }
156
156
 
157
157
  it "transfers a specified amount from a SourceAccount to a DestinationAccount" do
158
- source_account.amount.should == original_source_account_amount
159
- destination_account.amount.should == original_destination_account_amount
158
+ expect(source_account.amount).to eq original_source_account_amount
159
+ expect(destination_account.amount).to eq original_destination_account_amount
160
160
  subject.call(transfer_amount)
161
- source_account.amount.should == original_source_account_amount-transfer_amount
162
- destination_account.amount.should == original_destination_account_amount+transfer_amount
161
+ expect(source_account.amount).to eq original_source_account_amount-transfer_amount
162
+ expect(destination_account.amount).to eq original_destination_account_amount+transfer_amount
163
163
  end
164
164
 
165
165
  end
@@ -20,10 +20,4 @@ RSpec.configure do |config|
20
20
 
21
21
  config.mock_with :rspec
22
22
 
23
- ## perhaps this should be removed as well
24
- ## and done in Rakefile?
25
- config.color_enabled = true
26
- ## dont do this, do it in Rakefile instead
27
- #config.formatter = 'd'
28
-
29
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: role_playing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Axel Eriksson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-02 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.12.0
19
+ version: '3.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.12.0
26
+ version: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - .gitignore
63
+ - .rspec
63
64
  - .travis.yml
64
65
  - Gemfile
65
66
  - LICENSE.txt
@@ -94,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
95
  version: '0'
95
96
  requirements: []
96
97
  rubyforge_project:
97
- rubygems_version: 2.0.2
98
+ rubygems_version: 2.0.14
98
99
  signing_key:
99
100
  specification_version: 4
100
101
  summary: A ruby DCI implementation