glimmer 0.1.11.470 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.markdown +104 -66
- data/bin/girb +1 -3
- data/bin/glimmer +1 -1
- data/lib/glimmer_application.rb +35 -76
- data/vendor/swt/linux/swt.jar +0 -0
- data/vendor/swt/mac/swt.jar +0 -0
- data/vendor/swt/windows/swt.jar +0 -0
- metadata +15 -55
- data/.coveralls.yml +0 -1
- data/.rspec +0 -2
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/Gemfile +0 -14
- data/RELEASE.md +0 -15
- data/Rakefile +0 -43
- data/TODO.md +0 -12
- data/VERSION +0 -1
- data/bin/girb_runner.rb +0 -1
- data/glimmer.gemspec +0 -160
- data/images/Bitter-sweet.jpg +0 -0
- data/samples/contactmanager/contact.rb +0 -9
- data/samples/contactmanager/contact_manager.rb +0 -71
- data/samples/contactmanager/contact_manager_presenter.rb +0 -24
- data/samples/contactmanager/contact_repository.rb +0 -24
- data/samples/hello_combo.rb +0 -36
- data/samples/hello_list_multi_selection.rb +0 -46
- data/samples/hello_list_single_selection.rb +0 -36
- data/samples/hello_tab.rb +0 -26
- data/samples/hello_world.rb +0 -10
- data/samples/hellocomputed/contact.rb +0 -19
- data/samples/hellocomputed/hello_computed.rb +0 -68
- data/samples/login.rb +0 -92
- data/samples/tictactoe/tic_tac_toe.rb +0 -64
- data/samples/tictactoe/tic_tac_toe_board.rb +0 -146
- data/spec/lib/command_handlers/models/observable_model_spec.rb +0 -22
- data/spec/lib/command_handlers/models/r_widget_spec.rb +0 -52
- data/spec/lib/glimmer__combo_data_binding__spec.rb +0 -130
- data/spec/lib/glimmer__constant__spec.rb +0 -30
- data/spec/lib/glimmer__data_binding__spec.rb +0 -404
- data/spec/lib/glimmer__list_data_binding__spec.rb +0 -224
- data/spec/lib/glimmer__listeners__spec.rb +0 -60
- data/spec/lib/glimmer__shine_data_binding__spec.rb +0 -89
- data/spec/lib/glimmer__tab_item__spec.rb +0 -55
- data/spec/lib/glimmer__table_data_binding__spec.rb +0 -121
- data/spec/lib/glimmer__tree_data_binding__spec.rb +0 -113
- data/spec/lib/glimmer_spec.rb +0 -251
- data/spec/lib/xml/glimmer_xml_spec.rb +0 -154
- data/spec/samples/contactmanager/contact_manager_presenter_spec.rb +0 -81
- data/spec/samples/tictactoe/tic_tac_toe_spec.rb +0 -263
- data/spec/spec_helper.rb +0 -124
@@ -1,81 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require_relative "../../../samples/contactmanager/contact_manager_presenter"
|
3
|
-
|
4
|
-
describe ContactManagerPresenter do
|
5
|
-
|
6
|
-
it "tests find_specify_all_fields_for_one_result" do
|
7
|
-
contact_manager_presenter = ContactManagerPresenter.new
|
8
|
-
contact_manager_presenter.first_name = "Frank"
|
9
|
-
contact_manager_presenter.last_name = "Deelio"
|
10
|
-
contact_manager_presenter.email = "frank@deelio.com"
|
11
|
-
contact_manager_presenter.find
|
12
|
-
contacts = contact_manager_presenter.results
|
13
|
-
expect(contacts).to_not be_nil
|
14
|
-
expect(contacts.size).to eq( 1)
|
15
|
-
contact = contacts[0]
|
16
|
-
expect(contact.is_a?(Contact)).to be_true
|
17
|
-
expect(contact.first_name).to eq( "Frank")
|
18
|
-
expect(contact.last_name).to eq( "Deelio")
|
19
|
-
expect(contact.email).to eq( "frank@deelio.com")
|
20
|
-
end
|
21
|
-
|
22
|
-
it "tests find_specify_one_field_for_two_results" do
|
23
|
-
contact_manager_presenter = ContactManagerPresenter.new
|
24
|
-
contact_manager_presenter.first_name = "Frank"
|
25
|
-
contact_manager_presenter.find
|
26
|
-
contacts = contact_manager_presenter.results
|
27
|
-
expect(contacts).to_not be_nil
|
28
|
-
expect(contacts.size).to eq( 2)
|
29
|
-
contact1 = contacts[0]
|
30
|
-
contact2 = contacts[1]
|
31
|
-
expect(contact1.first_name).to eq( "Frank")
|
32
|
-
expect(contact1.last_name).to eq( "Deelio")
|
33
|
-
expect(contact1.email).to eq( "frank@deelio.com")
|
34
|
-
expect(contact2.first_name).to eq( "franky")
|
35
|
-
expect(contact2.last_name).to eq( "miller")
|
36
|
-
expect(contact2.email).to eq( "frank@miller.com")
|
37
|
-
end
|
38
|
-
|
39
|
-
it "tests find_specify_all_fields_for_no_results" do
|
40
|
-
contact_manager_presenter = ContactManagerPresenter.new
|
41
|
-
contact_manager_presenter.first_name = "Julia"
|
42
|
-
contact_manager_presenter.last_name = "Big"
|
43
|
-
contact_manager_presenter.email = "julia@big.com"
|
44
|
-
contact_manager_presenter.find
|
45
|
-
contacts = contact_manager_presenter.results
|
46
|
-
expect(contacts).to_not be_nil
|
47
|
-
expect(contacts.size).to eq( 0)
|
48
|
-
end
|
49
|
-
|
50
|
-
it "tests find_specify_no_fields_for_all_results" do
|
51
|
-
contact_manager_presenter = ContactManagerPresenter.new
|
52
|
-
contact_manager_presenter.find
|
53
|
-
contacts = contact_manager_presenter.results
|
54
|
-
expect(contacts).to_not be_nil
|
55
|
-
expect(contacts.size).to eq( 4)
|
56
|
-
expect(contacts[0].first_name).to eq( "Anne")
|
57
|
-
expect(contacts[1].first_name).to eq( "Beatrice")
|
58
|
-
expect(contacts[2].first_name).to eq( "Frank")
|
59
|
-
expect(contacts[3].first_name).to eq( "franky")
|
60
|
-
end
|
61
|
-
|
62
|
-
it "tests list_all_results" do
|
63
|
-
contact_manager_presenter = ContactManagerPresenter.new
|
64
|
-
contact_manager_presenter.list
|
65
|
-
contacts = contact_manager_presenter.results
|
66
|
-
expect(contacts).to_not be_nil
|
67
|
-
expect(contacts.size).to eq( 4)
|
68
|
-
expect(contacts[0].first_name).to eq( "Anne")
|
69
|
-
expect(contacts[1].first_name).to eq( "Beatrice")
|
70
|
-
expect(contacts[2].first_name).to eq( "Frank")
|
71
|
-
expect(contacts[3].first_name).to eq( "franky")
|
72
|
-
end
|
73
|
-
|
74
|
-
it "tests initial_results" do
|
75
|
-
contact_manager_presenter = ContactManagerPresenter.new
|
76
|
-
contacts = contact_manager_presenter.results
|
77
|
-
expect(contacts).to_not be_nil
|
78
|
-
expect(contacts.size).to eq( 0)
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
@@ -1,263 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
require_relative "../../../samples/tictactoe/tic_tac_toe_board"
|
4
|
-
|
5
|
-
describe TicTacToeBoard do
|
6
|
-
|
7
|
-
before do
|
8
|
-
@board = TicTacToeBoard.new
|
9
|
-
end
|
10
|
-
|
11
|
-
it "tests mark_center_x" do
|
12
|
-
expect(@board.box(2, 2).sign).to eq("")
|
13
|
-
@board.mark_box(2, 2)
|
14
|
-
expect(@board.box(2, 2).empty).to be_false
|
15
|
-
expect(@board.box(2, 2).sign).to eq("X")
|
16
|
-
expect(@board.box(1, 1).empty).to be_true
|
17
|
-
expect(@board.box(1, 2).empty).to be_true
|
18
|
-
expect(@board.box(1, 3).empty).to be_true
|
19
|
-
expect(@board.box(2, 1).empty).to be_true
|
20
|
-
expect(@board.box(2, 3).empty).to be_true
|
21
|
-
expect(@board.box(3, 1).empty).to be_true
|
22
|
-
expect(@board.box(3, 2).empty).to be_true
|
23
|
-
expect(@board.box(3, 3).empty).to be_true
|
24
|
-
end
|
25
|
-
|
26
|
-
it "tests mark_center_x_top_center_o_bottom_right_x" do
|
27
|
-
@board.mark_box(2, 2)
|
28
|
-
@board.mark_box(1, 2)
|
29
|
-
@board.mark_box(3, 3)
|
30
|
-
expect(@board.box(2, 2).empty).to be_false
|
31
|
-
expect(@board.box(1, 2).empty).to be_false
|
32
|
-
expect(@board.box(3, 3).empty).to be_false
|
33
|
-
expect(@board.box(2, 2).sign).to eq("X")
|
34
|
-
expect(@board.box(1, 2).sign).to eq("O")
|
35
|
-
expect(@board.box(3, 3).sign).to eq("X")
|
36
|
-
end
|
37
|
-
|
38
|
-
it "tests top_center_not_marked" do
|
39
|
-
expect(@board.box(1, 2).empty).to be_true
|
40
|
-
end
|
41
|
-
|
42
|
-
it "tests top_right_marked" do
|
43
|
-
@board.mark_box(1, 3)
|
44
|
-
expect(@board.box(1, 3).empty).to be_false
|
45
|
-
end
|
46
|
-
|
47
|
-
it "tests lower_right_marked" do
|
48
|
-
@board.mark_box(3, 3)
|
49
|
-
expect(@board.box(3, 3).empty).to be_false
|
50
|
-
end
|
51
|
-
|
52
|
-
it "tests game_over_false" do
|
53
|
-
expect(@board.game_over?).to be_false
|
54
|
-
expect(@board.current_sign).to eq("X")
|
55
|
-
expect(@board.game_status).to eq(TicTacToeBoard::IN_PROGRESS)
|
56
|
-
end
|
57
|
-
|
58
|
-
it "tests game_over_X_wins_top_row_across" do
|
59
|
-
@board.mark_box(1, 1)
|
60
|
-
expect(@board.box(1, 1).sign).to eq("X")
|
61
|
-
@board.mark_box(2, 1)
|
62
|
-
expect(@board.box(2, 1).sign).to eq("O")
|
63
|
-
@board.mark_box(1, 2)
|
64
|
-
expect(@board.box(1, 2).sign).to eq("X")
|
65
|
-
@board.mark_box(2, 2)
|
66
|
-
expect(@board.box(2, 2).sign).to eq("O")
|
67
|
-
@board.mark_box(1, 3)
|
68
|
-
expect(@board.box(1, 3).sign).to eq("X")
|
69
|
-
expect(@board.game_over?).to be_true
|
70
|
-
expect(@board.winning_sign).to eq("X")
|
71
|
-
expect(@board.game_status).to eq(TicTacToeBoard::WIN)
|
72
|
-
end
|
73
|
-
|
74
|
-
it "tests game_over_O_wins_top_row_across" do
|
75
|
-
@board.mark_box(2, 1)
|
76
|
-
@board.mark_box(1, 1)
|
77
|
-
@board.mark_box(2, 2)
|
78
|
-
@board.mark_box(1, 2)
|
79
|
-
@board.mark_box(3, 3)
|
80
|
-
@board.mark_box(1, 3)
|
81
|
-
expect(@board.game_over?).to be_true
|
82
|
-
expect(@board.winning_sign).to eq("O")
|
83
|
-
end
|
84
|
-
|
85
|
-
it "tests game_over_X_wins_second_row_across" do
|
86
|
-
@board.mark_box(2, 1)
|
87
|
-
@board.mark_box(1, 1)
|
88
|
-
@board.mark_box(2, 2)
|
89
|
-
@board.mark_box(1, 2)
|
90
|
-
@board.mark_box(2, 3)
|
91
|
-
expect(@board.game_over?).to be_true
|
92
|
-
expect(@board.winning_sign).to eq("X")
|
93
|
-
end
|
94
|
-
|
95
|
-
it "tests game_over_O_wins_second_row_across" do
|
96
|
-
@board.mark_box(1, 1)
|
97
|
-
@board.mark_box(2, 1)
|
98
|
-
@board.mark_box(3, 1)
|
99
|
-
@board.mark_box(2, 2)
|
100
|
-
@board.mark_box(1, 2)
|
101
|
-
@board.mark_box(2, 3)
|
102
|
-
expect(@board.game_over?).to be_true
|
103
|
-
expect(@board.winning_sign).to eq("O")
|
104
|
-
end
|
105
|
-
|
106
|
-
it "tests game_over_X_wins_third_row_across" do
|
107
|
-
@board.mark_box(3, 1)
|
108
|
-
@board.mark_box(1, 1)
|
109
|
-
@board.mark_box(3, 2)
|
110
|
-
@board.mark_box(1, 2)
|
111
|
-
@board.mark_box(3, 3)
|
112
|
-
expect(@board.game_over?).to be_true
|
113
|
-
expect(@board.winning_sign).to eq("X")
|
114
|
-
end
|
115
|
-
|
116
|
-
it "tests game_over_O_wins_third_row_across" do
|
117
|
-
@board.mark_box(1, 1)
|
118
|
-
@board.mark_box(3, 1)
|
119
|
-
@board.mark_box(1, 2)
|
120
|
-
@board.mark_box(3, 2)
|
121
|
-
@board.mark_box(2, 3)
|
122
|
-
@board.mark_box(3, 3)
|
123
|
-
expect(@board.game_over?).to be_true
|
124
|
-
end
|
125
|
-
|
126
|
-
it "tests game_over_X_wins_first_column_down" do
|
127
|
-
@board.mark_box(1, 1)
|
128
|
-
@board.mark_box(2, 2)
|
129
|
-
@board.mark_box(2, 1)
|
130
|
-
@board.mark_box(3, 2)
|
131
|
-
@board.mark_box(3, 1)
|
132
|
-
expect(@board.game_over?).to be_true
|
133
|
-
expect(@board.winning_sign).to eq("X")
|
134
|
-
end
|
135
|
-
|
136
|
-
it "tests game_over_O_wins_first_column_down" do
|
137
|
-
@board.mark_box(2, 2)
|
138
|
-
@board.mark_box(1, 1)
|
139
|
-
@board.mark_box(3, 2)
|
140
|
-
@board.mark_box(2, 1)
|
141
|
-
@board.mark_box(3, 3)
|
142
|
-
@board.mark_box(3, 1)
|
143
|
-
expect(@board.game_over?).to be_true
|
144
|
-
end
|
145
|
-
|
146
|
-
it "tests game_over_X_wins_second_column_down" do
|
147
|
-
@board.mark_box(1, 2)
|
148
|
-
@board.mark_box(2, 1)
|
149
|
-
@board.mark_box(2, 2)
|
150
|
-
@board.mark_box(3, 1)
|
151
|
-
@board.mark_box(3, 2)
|
152
|
-
expect(@board.game_over?).to be_true
|
153
|
-
expect(@board.winning_sign).to eq("X")
|
154
|
-
end
|
155
|
-
|
156
|
-
it "tests game_over_O_wins_second_column_down" do
|
157
|
-
@board.mark_box(2, 1)
|
158
|
-
@board.mark_box(1, 2)
|
159
|
-
@board.mark_box(3, 1)
|
160
|
-
@board.mark_box(2, 2)
|
161
|
-
@board.mark_box(2, 3)
|
162
|
-
@board.mark_box(3, 2)
|
163
|
-
expect(@board.game_over?).to be_true
|
164
|
-
expect(@board.winning_sign).to eq("O")
|
165
|
-
end
|
166
|
-
|
167
|
-
it "tests game_over_X_wins_third_column_down" do
|
168
|
-
@board.mark_box(1, 3)
|
169
|
-
@board.mark_box(2, 1)
|
170
|
-
@board.mark_box(2, 3)
|
171
|
-
@board.mark_box(3, 1)
|
172
|
-
@board.mark_box(3, 3)
|
173
|
-
expect(@board.game_over?).to be_true
|
174
|
-
expect(@board.winning_sign).to eq("X")
|
175
|
-
end
|
176
|
-
|
177
|
-
it "tests game_over_O_wins_third_column_down" do
|
178
|
-
@board.mark_box(2, 1)
|
179
|
-
@board.mark_box(1, 3)
|
180
|
-
@board.mark_box(3, 1)
|
181
|
-
@board.mark_box(2, 3)
|
182
|
-
@board.mark_box(3, 2)
|
183
|
-
@board.mark_box(3, 3)
|
184
|
-
expect(@board.game_over?).to be_true
|
185
|
-
expect(@board.winning_sign).to eq("O")
|
186
|
-
end
|
187
|
-
|
188
|
-
it "tests game_over_X_wins_top_left_to_bottom_right" do
|
189
|
-
@board.mark_box(1, 1)
|
190
|
-
@board.mark_box(2, 1)
|
191
|
-
@board.mark_box(2, 2)
|
192
|
-
@board.mark_box(3, 2)
|
193
|
-
@board.mark_box(3, 3)
|
194
|
-
expect(@board.winning_sign).to eq("X")
|
195
|
-
expect(@board.game_over?).to be_true
|
196
|
-
end
|
197
|
-
|
198
|
-
it "tests game_over_O_wins_top_left_to_bottom_right" do
|
199
|
-
@board.mark_box(2, 1)
|
200
|
-
@board.mark_box(1, 1)
|
201
|
-
@board.mark_box(3, 2)
|
202
|
-
@board.mark_box(2, 2)
|
203
|
-
@board.mark_box(2, 3)
|
204
|
-
@board.mark_box(3, 3)
|
205
|
-
expect(@board.winning_sign).to eq("O")
|
206
|
-
expect(@board.game_over?).to be_true
|
207
|
-
end
|
208
|
-
|
209
|
-
it "tests game_over_X_wins_top_right_to_bottom_left" do
|
210
|
-
@board.mark_box(1, 3)
|
211
|
-
@board.mark_box(2, 1)
|
212
|
-
@board.mark_box(2, 2)
|
213
|
-
@board.mark_box(3, 2)
|
214
|
-
@board.mark_box(3, 1)
|
215
|
-
expect(@board.winning_sign).to eq("X")
|
216
|
-
expect(@board.game_over?).to be_true
|
217
|
-
end
|
218
|
-
|
219
|
-
it "tests game_over_O_wins_top_right_to_bottom_left" do
|
220
|
-
@board.mark_box(2, 1)
|
221
|
-
@board.mark_box(1, 3)
|
222
|
-
@board.mark_box(3, 2)
|
223
|
-
@board.mark_box(2, 2)
|
224
|
-
@board.mark_box(1, 1)
|
225
|
-
@board.mark_box(3, 1)
|
226
|
-
expect(@board.winning_sign).to eq("O")
|
227
|
-
expect(@board.game_over?).to be_true
|
228
|
-
end
|
229
|
-
|
230
|
-
# 1 2 3
|
231
|
-
#1 x o x
|
232
|
-
#2 o x x
|
233
|
-
#3 o x o
|
234
|
-
it "tests game_over_draw" do
|
235
|
-
@board.mark_box(1, 1)
|
236
|
-
@board.mark_box(1, 2)
|
237
|
-
@board.mark_box(1, 3)
|
238
|
-
@board.mark_box(2, 1)
|
239
|
-
@board.mark_box(2, 2)
|
240
|
-
@board.mark_box(3, 1)
|
241
|
-
@board.mark_box(2, 3)
|
242
|
-
@board.mark_box(3, 3)
|
243
|
-
expect(@board.game_over?).to be_false
|
244
|
-
@board.mark_box(3, 2)
|
245
|
-
expect(@board.game_over?).to be_true
|
246
|
-
expect(@board.winning_sign).to eq(TicTacToeBox::EMPTY)
|
247
|
-
expect(@board.game_status).to eq(TicTacToeBoard::DRAW)
|
248
|
-
end
|
249
|
-
|
250
|
-
it "tests reset" do
|
251
|
-
@board.mark_box(1, 3)
|
252
|
-
@board.mark_box(2, 1)
|
253
|
-
@board.mark_box(2, 2)
|
254
|
-
@board.mark_box(3, 2)
|
255
|
-
@board.mark_box(3, 1)
|
256
|
-
@board.reset
|
257
|
-
expect(@board.game_over?).to be_false
|
258
|
-
expect(@board.winning_sign).to eq(TicTacToeBox::EMPTY)
|
259
|
-
expect(@board.game_status).to eq(TicTacToeBoard::IN_PROGRESS)
|
260
|
-
expect(@board.current_sign).to eq("X")
|
261
|
-
end
|
262
|
-
|
263
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,124 +0,0 @@
|
|
1
|
-
require 'coveralls'
|
2
|
-
Coveralls.wear!
|
3
|
-
require 'bundler'
|
4
|
-
|
5
|
-
begin
|
6
|
-
Bundler.require(:default, :development)
|
7
|
-
rescue Bundler::BundlerError => e
|
8
|
-
$stderr.puts e.message
|
9
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
-
exit e.status_code
|
11
|
-
end
|
12
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
13
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'samples'))
|
14
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
-
require 'glimmer'
|
16
|
-
require 'puts_debuggerer'
|
17
|
-
# This file was generated by the `rspec --init` command. Conventionally, all
|
18
|
-
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
19
|
-
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
20
|
-
# this file to always be loaded, without a need to explicitly require it in any
|
21
|
-
# files.
|
22
|
-
#
|
23
|
-
# Given that it is always loaded, you are encouraged to keep this file as
|
24
|
-
# light-weight as possible. Requiring heavyweight dependencies from this file
|
25
|
-
# will add to the boot time of your test suite on EVERY test run, even for an
|
26
|
-
# individual file that may not need all of that loaded. Instead, consider making
|
27
|
-
# a separate helper file that requires the additional dependencies and performs
|
28
|
-
# the additional setup, and require it from the spec files that actually need
|
29
|
-
# it.
|
30
|
-
#
|
31
|
-
# The `.rspec` file also contains a few flags that are not defaults but that
|
32
|
-
# users commonly want.
|
33
|
-
#
|
34
|
-
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
35
|
-
RSpec.configure do |config|
|
36
|
-
# rspec-expectations config goes here. You can use an alternate
|
37
|
-
# assertion/expectation library such as wrong or the stdlib/minitest
|
38
|
-
# assertions if you prefer.
|
39
|
-
config.expect_with :rspec do |expectations|
|
40
|
-
# This option will default to `true` in RSpec 4. It makes the `description`
|
41
|
-
# and `failure_message` of custom matchers include text for helper methods
|
42
|
-
# defined using `chain`, e.g.:
|
43
|
-
# be_bigger_than(2).and_smaller_than(4).description
|
44
|
-
# # => "be bigger than 2 and smaller than 4"
|
45
|
-
# ...rather than:
|
46
|
-
# # => "be bigger than 2"
|
47
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
48
|
-
end
|
49
|
-
|
50
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
51
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
52
|
-
config.mock_with :rspec do |mocks|
|
53
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
54
|
-
# a real object. This is generally recommended, and will default to
|
55
|
-
# `true` in RSpec 4.
|
56
|
-
mocks.verify_partial_doubles = true
|
57
|
-
end
|
58
|
-
|
59
|
-
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
60
|
-
# have no way to turn it off -- the option exists only for backwards
|
61
|
-
# compatibility in RSpec 3). It causes shared context metadata to be
|
62
|
-
# inherited by the metadata hash of host groups and examples, rather than
|
63
|
-
# triggering implicit auto-inclusion in groups with matching metadata.
|
64
|
-
config.shared_context_metadata_behavior = :apply_to_host_groups
|
65
|
-
|
66
|
-
# The settings below are suggested to provide a good initial experience
|
67
|
-
# with RSpec, but feel free to customize to your heart's content.
|
68
|
-
=begin
|
69
|
-
# This allows you to limit a spec run to individual examples or groups
|
70
|
-
# you care about by tagging them with `:focus` metadata. When nothing
|
71
|
-
# is tagged with `:focus`, all examples get run. RSpec also provides
|
72
|
-
# aliases for `it`, `describe`, and `context` that include `:focus`
|
73
|
-
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
74
|
-
config.filter_run_when_matching :focus
|
75
|
-
|
76
|
-
# Allows RSpec to persist some state between runs in order to support
|
77
|
-
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
78
|
-
# you configure your source control system to ignore this file.
|
79
|
-
config.example_status_persistence_file_path = "spec/examples.txt"
|
80
|
-
|
81
|
-
# Limits the available syntax to the non-monkey patched syntax that is
|
82
|
-
# recommended. For more details, see:
|
83
|
-
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
84
|
-
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
85
|
-
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
86
|
-
config.disable_monkey_patching!
|
87
|
-
|
88
|
-
# This setting enables warnings. It's recommended, but in some cases may
|
89
|
-
# be too noisy due to issues in dependencies.
|
90
|
-
config.warnings = true
|
91
|
-
|
92
|
-
# Many RSpec users commonly either run the entire suite or an individual
|
93
|
-
# file, and it's useful to allow more verbose output when running an
|
94
|
-
# individual spec file.
|
95
|
-
if config.files_to_run.one?
|
96
|
-
# Use the documentation formatter for detailed output,
|
97
|
-
# unless a formatter has already been configured
|
98
|
-
# (e.g. via a command-line flag).
|
99
|
-
config.default_formatter = 'doc'
|
100
|
-
end
|
101
|
-
|
102
|
-
# Print the 10 slowest examples and example groups at the
|
103
|
-
# end of the spec run, to help surface which specs are running
|
104
|
-
# particularly slow.
|
105
|
-
config.profile_examples = 10
|
106
|
-
|
107
|
-
# Run specs in random order to surface order dependencies. If you find an
|
108
|
-
# order dependency and want to debug it, you can fix the order by providing
|
109
|
-
# the seed, which is printed after each run.
|
110
|
-
# --seed 1234
|
111
|
-
config.order = :random
|
112
|
-
|
113
|
-
# Seed global randomization in this process using the `--seed` CLI option.
|
114
|
-
# Setting this allows you to use `--seed` to deterministically reproduce
|
115
|
-
# test failures related to randomization by passing the same `--seed` value
|
116
|
-
# as the one that triggered the failure.
|
117
|
-
Kernel.srand config.seed
|
118
|
-
=end
|
119
|
-
end
|
120
|
-
RSpec::Matchers.define :have_style do |style|
|
121
|
-
match do |widget|
|
122
|
-
expect(widget.getStyle & style.swt_constant).to eq(style.swt_constant)
|
123
|
-
end
|
124
|
-
end
|