kalibro_gem 0.0.4 → 0.0.5

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.
@@ -20,14 +20,14 @@ describe KalibroGem::Entities::Reading do
20
20
  describe "id=" do
21
21
  it 'should set the id attribute as an integer' do
22
22
  subject.id = "44"
23
- subject.id.should eq(44)
23
+ expect(subject.id).to eq(44)
24
24
  end
25
25
  end
26
26
 
27
27
  describe "grade=" do
28
28
  it 'should set the grade attribute as a float' do
29
29
  subject.grade = "44.7"
30
- subject.grade.should eq(44.7)
30
+ expect(subject.grade).to eq(44.7)
31
31
  end
32
32
  end
33
33
 
@@ -45,7 +45,7 @@ describe KalibroGem::Entities::Reading do
45
45
 
46
46
  it 'should return a reading object' do
47
47
  response = KalibroGem::Entities::Reading.find reading.id
48
- response.label.should eq(reading.label)
48
+ expect(response.label).to eq(reading.label)
49
49
  end
50
50
  end
51
51
 
@@ -79,8 +79,8 @@ describe KalibroGem::Entities::Reading do
79
79
 
80
80
  it 'should returns a list of readings that belongs to the given reading group' do
81
81
  response = KalibroGem::Entities::Reading.readings_of reading_group.id
82
- response.first.label.should eq(reading.label)
83
- response.last.label.should eq(reading.label)
82
+ expect(response.first.label).to eq(reading.label)
83
+ expect(response.last.label).to eq(reading.label)
84
84
  end
85
85
  end
86
86
 
@@ -98,7 +98,7 @@ describe KalibroGem::Entities::Reading do
98
98
  end
99
99
 
100
100
  it 'should list all the readings' do
101
- KalibroGem::Entities::Reading.all.should include(subject)
101
+ expect(KalibroGem::Entities::Reading.all).to include(subject)
102
102
  end
103
103
  end
104
104
  end
@@ -116,9 +116,9 @@ describe KalibroGem::Entities::Reading do
116
116
  end
117
117
 
118
118
  it 'should make a request to save model with id and return true without errors' do
119
- reading.save.should be(true)
120
- reading.id.should eq(reading_id)
121
- reading.kalibro_errors.should be_empty
119
+ expect(reading.save).to be(true)
120
+ expect(reading.id).to eq(reading_id)
121
+ expect(reading.kalibro_errors).to be_empty
122
122
  end
123
123
  end
124
124
 
@@ -131,7 +131,7 @@ describe KalibroGem::Entities::Reading do
131
131
  end
132
132
 
133
133
  it 'should return true' do
134
- KalibroGem::Entities::Reading.exists?(subject.id).should be_true
134
+ expect(KalibroGem::Entities::Reading.exists?(subject.id)).to be_truthy
135
135
  end
136
136
  end
137
137
 
@@ -141,7 +141,7 @@ describe KalibroGem::Entities::Reading do
141
141
  end
142
142
 
143
143
  it 'should return false' do
144
- KalibroGem::Entities::Reading.exists?(subject.id).should be_false
144
+ expect(KalibroGem::Entities::Reading.exists?(subject.id)).to be_falsey
145
145
  end
146
146
  end
147
147
  end
@@ -20,7 +20,7 @@ describe KalibroGem::Entities::RepositoryObserver do
20
20
  describe 'id=' do
21
21
  it 'should set the value of the attribute id' do
22
22
  subject.id = 42
23
- subject.id.should eq(42)
23
+ expect(subject.id).to eq(42)
24
24
  end
25
25
  end
26
26
 
@@ -34,7 +34,7 @@ describe KalibroGem::Entities::RepositoryObserver do
34
34
  end
35
35
 
36
36
  it 'should return nil' do
37
- KalibroGem::Entities::RepositoryObserver.all.should be_empty
37
+ expect(KalibroGem::Entities::RepositoryObserver.all).to be_empty
38
38
  end
39
39
  end
40
40
 
@@ -49,9 +49,9 @@ describe KalibroGem::Entities::RepositoryObserver do
49
49
 
50
50
  it 'should return the two elements' do
51
51
  repository_observers = KalibroGem::Entities::RepositoryObserver.all
52
- repository_observers.size.should eq(2)
53
- repository_observers.first.name.should eq(repository_observer.to_hash[:name])
54
- repository_observers.last.name.should eq(repository_observer.to_hash[:name])
52
+ expect(repository_observers.size).to eq(2)
53
+ expect(repository_observers.first.name).to eq(repository_observer.to_hash[:name])
54
+ expect(repository_observers.last.name).to eq(repository_observer.to_hash[:name])
55
55
  end
56
56
  end
57
57
  end
@@ -67,8 +67,8 @@ describe KalibroGem::Entities::RepositoryObserver do
67
67
  end
68
68
 
69
69
  it 'should get an empty array' do
70
- KalibroGem::Entities::RepositoryObserver.
71
- repository_observers_of(repository_without_observers[:id]).should eq []
70
+ expect(KalibroGem::Entities::RepositoryObserver.
71
+ repository_observers_of(repository_without_observers[:id])).to eq []
72
72
  end
73
73
  end
74
74
 
@@ -86,9 +86,9 @@ describe KalibroGem::Entities::RepositoryObserver do
86
86
  repository_observers = KalibroGem::Entities::RepositoryObserver.
87
87
  repository_observers_of(repository.id)
88
88
 
89
- repository_observers.size.should eq(2)
90
- repository_observers.first.name.should eq(repository_observer.name)
91
- repository_observers.last.name.should eq(repository_observer.name)
89
+ expect(repository_observers.size).to eq(2)
90
+ expect(repository_observers.first.name).to eq(repository_observer.name)
91
+ expect(repository_observers.last.name).to eq(repository_observer.name)
92
92
  end
93
93
  end
94
94
  end
@@ -96,28 +96,28 @@ describe KalibroGem::Entities::RepositoryObserver do
96
96
  describe 'id=' do
97
97
  it 'should set the value of the attribute id' do
98
98
  subject.id = 65
99
- subject.id.should eq(65)
99
+ expect(subject.id).to eq(65)
100
100
  end
101
101
  end
102
102
 
103
103
  describe 'repository_id=' do
104
104
  it 'should set the value of the attribute repository_id' do
105
105
  subject.repository_id = 91
106
- subject.repository_id.should eq(91)
106
+ expect(subject.repository_id).to eq(91)
107
107
  end
108
108
  end
109
109
 
110
110
  describe 'name=' do
111
111
  it 'should set the value of the attribute name' do
112
112
  subject.name = 'William'
113
- subject.name.should eq('William')
113
+ expect(subject.name).to eq('William')
114
114
  end
115
115
  end
116
116
 
117
117
  describe 'email=' do
118
118
  it 'should set the value of the attribute email' do
119
119
  subject.email = 'william@email.com'
120
- subject.email.should eq('william@email.com')
120
+ expect(subject.email).to eq('william@email.com')
121
121
  end
122
122
  end
123
123
  end
@@ -29,7 +29,7 @@ describe KalibroGem::Entities::Repository do
29
29
  end
30
30
 
31
31
  it 'should return an array of repository types' do
32
- KalibroGem::Entities::Repository.repository_types.should eq(["BAZAAR", "GIT", "MERCURIAL", "REMOTE_TARBALL", "REMOTE_ZIP"])
32
+ expect(KalibroGem::Entities::Repository.repository_types).to eq(["BAZAAR", "GIT", "MERCURIAL", "REMOTE_TARBALL", "REMOTE_ZIP"])
33
33
  end
34
34
  end
35
35
 
@@ -43,12 +43,12 @@ describe KalibroGem::Entities::Repository do
43
43
  end
44
44
 
45
45
  it 'should return an array' do
46
- KalibroGem::Entities::Repository.repositories_of(1).should be_an(Array)
46
+ expect(KalibroGem::Entities::Repository.repositories_of(1)).to be_an(Array)
47
47
  end
48
48
 
49
49
  it 'should set the repository_id' do
50
50
  KalibroGem::Entities::Repository.repositories_of(1).each do |repository|
51
- repository.project_id.should eq(1)
51
+ expect(repository.project_id).to eq(1)
52
52
  end
53
53
  end
54
54
  end
@@ -56,21 +56,21 @@ describe KalibroGem::Entities::Repository do
56
56
  describe "id=" do
57
57
  it 'should set the id attribute values as integer' do
58
58
  subject.id = "222"
59
- subject.id.should eq(222)
59
+ expect(subject.id).to eq(222)
60
60
  end
61
61
  end
62
62
 
63
63
  describe "process_period=" do
64
64
  it 'should set the process_period attribute values as integer' do
65
65
  subject.process_period = "222"
66
- subject.process_period.should eq(222)
66
+ expect(subject.process_period).to eq(222)
67
67
  end
68
68
  end
69
69
 
70
70
  describe "configuration_id=" do
71
71
  it 'should set the configuration_id attribute values as integer' do
72
72
  subject.configuration_id = "222"
73
- subject.configuration_id.should eq(222)
73
+ expect(subject.configuration_id).to eq(222)
74
74
  end
75
75
  end
76
76
 
@@ -112,7 +112,7 @@ describe KalibroGem::Entities::Repository do
112
112
  end
113
113
 
114
114
  it 'should list all the repositories' do
115
- KalibroGem::Entities::Repository.all.should include(subject)
115
+ expect(KalibroGem::Entities::Repository.all).to include(subject)
116
116
  end
117
117
  end
118
118
 
@@ -125,7 +125,7 @@ describe KalibroGem::Entities::Repository do
125
125
  end
126
126
 
127
127
  it 'should return the repository' do
128
- KalibroGem::Entities::Repository.find(subject.id).should eq(subject)
128
+ expect(KalibroGem::Entities::Repository.find(subject.id)).to eq(subject)
129
129
  end
130
130
  end
131
131
 
@@ -160,8 +160,8 @@ describe KalibroGem::Entities::Repository do
160
160
  end
161
161
 
162
162
  it 'should make a request to save model with id and return true without errors' do
163
- subject.save.should be(true)
164
- subject.kalibro_errors.should be_empty
163
+ expect(subject.save).to be(true)
164
+ expect(subject.kalibro_errors).to be_empty
165
165
  end
166
166
  end
167
167
 
@@ -174,7 +174,7 @@ describe KalibroGem::Entities::Repository do
174
174
  end
175
175
 
176
176
  it 'should return true' do
177
- KalibroGem::Entities::Repository.exists?(subject.id).should be_true
177
+ expect(KalibroGem::Entities::Repository.exists?(subject.id)).to be_truthy
178
178
  end
179
179
  end
180
180
 
@@ -184,7 +184,7 @@ describe KalibroGem::Entities::Repository do
184
184
  end
185
185
 
186
186
  it 'should return false' do
187
- KalibroGem::Entities::Repository.exists?(subject.id).should be_false
187
+ expect(KalibroGem::Entities::Repository.exists?(subject.id)).to be_falsey
188
188
  end
189
189
  end
190
190
  end
@@ -20,7 +20,7 @@ describe KalibroGem::Entities::StackTraceElement do
20
20
  describe 'line_number=' do
21
21
  it 'should set the line_number' do
22
22
  subject.line_number = 42
23
- subject.line_number.should eq(42)
23
+ expect(subject.line_number).to eq(42)
24
24
  end
25
25
  end
26
26
  end
@@ -22,21 +22,21 @@ describe KalibroGem::Entities::Throwable do
22
22
  describe 'stack_trace_element=' do
23
23
  it 'should set the stack trace element' do
24
24
  subject.stack_trace_element = stack_trace_element.to_hash
25
- subject.stack_trace_element.should eq([stack_trace_element])
25
+ expect(subject.stack_trace_element).to eq([stack_trace_element])
26
26
  end
27
27
  end
28
28
 
29
29
  describe 'stack_trace' do
30
30
  it 'should return the stack trace element' do
31
31
  subject.stack_trace_element = stack_trace_element.to_hash
32
- subject.stack_trace.should eq([stack_trace_element])
32
+ expect(subject.stack_trace).to eq([stack_trace_element])
33
33
  end
34
34
  end
35
35
 
36
36
  describe 'stack_trace=' do
37
37
  it 'should set the stack trace element' do
38
38
  subject.stack_trace = [stack_trace_element]
39
- subject.stack_trace_element.should eq([stack_trace_element])
39
+ expect(subject.stack_trace_element).to eq([stack_trace_element])
40
40
  end
41
41
  end
42
42
 
@@ -45,7 +45,7 @@ describe KalibroGem::Entities::Throwable do
45
45
 
46
46
  it 'should set the cause' do
47
47
  subject.cause = another_throwable.to_hash
48
- subject.cause.should eq(another_throwable)
48
+ expect(subject.cause).to eq(another_throwable)
49
49
  end
50
50
  end
51
51
  end
@@ -21,7 +21,7 @@ include AggregationOptions
21
21
 
22
22
  describe 'all_with_label' do
23
23
  it 'should return the list of aggregation methods available' do
24
- all_with_label.should eq(
24
+ expect(all_with_label).to eq(
25
25
  [
26
26
  ["Average","AVERAGE"], ["Median", "MEDIAN"], ["Maximum", "MAXIMUM"], ["Minimum", "MINIMUM"],
27
27
  ["Count", "COUNT"], ["Standard Deviation", "STANDARD_DEVIATION"]
@@ -23,7 +23,7 @@ describe HashConverters do
23
23
  describe 'date_with_miliseconds' do
24
24
  context 'with 21/12/1995 (first Ruby publication)' do
25
25
  it 'should return 1995-12-21T00:00:00.0/1+00:00' do
26
- date_with_milliseconds(DateTime.parse("21/12/1995")).should eq("1995-12-21T00:00:00.0/1+00:00")
26
+ expect(date_with_milliseconds(DateTime.parse("21/12/1995"))).to eq("1995-12-21T00:00:00.0/1+00:00")
27
27
  end
28
28
  end
29
29
  end
@@ -31,7 +31,7 @@ describe HashConverters do
31
31
  describe 'convert_to_hash' do
32
32
  context 'with a nil value' do
33
33
  it 'should return nil' do
34
- convert_to_hash(nil).should be_nil
34
+ expect(convert_to_hash(nil)).to be_nil
35
35
  end
36
36
  end
37
37
 
@@ -44,7 +44,7 @@ describe HashConverters do
44
44
  end
45
45
 
46
46
  it 'should return the Array wth its elements converted' do
47
- convert_to_hash(@array)[0].should eq(@element1.to_s)
47
+ expect(convert_to_hash(@array)[0]).to eq(@element1.to_s)
48
48
  end
49
49
  end
50
50
 
@@ -54,7 +54,7 @@ describe HashConverters do
54
54
  end
55
55
 
56
56
  it "should return the Model's Hash" do
57
- convert_to_hash(@model).should eq(@model.to_hash)
57
+ expect(convert_to_hash(@model)).to eq(@model.to_hash)
58
58
  end
59
59
  end
60
60
 
@@ -64,19 +64,19 @@ describe HashConverters do
64
64
  end
65
65
 
66
66
  it 'should return th date with miliseconds' do
67
- convert_to_hash(@date).should eq(date_with_milliseconds(@date))
67
+ expect(convert_to_hash(@date)).to eq(date_with_milliseconds(@date))
68
68
  end
69
69
  end
70
70
 
71
71
  context 'with an + infinite Float' do
72
72
  it 'should return INF' do
73
- convert_to_hash(1.0/0.0).should eq('INF')
73
+ expect(convert_to_hash(1.0/0.0)).to eq('INF')
74
74
  end
75
75
  end
76
76
 
77
77
  context 'with an - infinite Float' do
78
78
  it 'should return -INF' do
79
- convert_to_hash(-1.0/0.0).should eq('-INF')
79
+ expect(convert_to_hash(-1.0/0.0)).to eq('-INF')
80
80
  end
81
81
  end
82
82
  end
@@ -89,11 +89,11 @@ describe HashConverters do
89
89
  end
90
90
 
91
91
  it 'should return an instance of Hash' do
92
- @model.field_to_hash(:field_getter).should be_a(Hash)
92
+ expect(@model.field_to_hash(:field_getter)).to be_a(Hash)
93
93
  end
94
94
 
95
95
  it 'should return an empty Hash' do
96
- @model.field_to_hash(:field_getter).should eq({})
96
+ expect(@model.field_to_hash(:field_getter)).to eq({})
97
97
  end
98
98
  end
99
99
 
@@ -104,7 +104,7 @@ describe HashConverters do
104
104
  end
105
105
 
106
106
  it 'should return an instance of Hash' do
107
- @model.field_to_hash(:field_getter).should be_a(Hash)
107
+ expect(@model.field_to_hash(:field_getter)).to be_a(Hash)
108
108
  end
109
109
  end
110
110
  end
@@ -24,7 +24,7 @@ describe XMLConverters do
24
24
  before { @model = KalibroGem::Entities::Model.new }
25
25
 
26
26
  it 'should return modelXml' do
27
- xml_instance_class_name(@model).should eq('modelXml')
27
+ expect(xml_instance_class_name(@model)).to eq('modelXml')
28
28
  end
29
29
  end
30
30
 
@@ -33,11 +33,11 @@ describe XMLConverters do
33
33
  before { @object = "kalibro" }
34
34
 
35
35
  it 'should return a Hash' do
36
- get_xml("field", @object).should be_a(Hash)
36
+ expect(get_xml("field", @object)).to be_a(Hash)
37
37
  end
38
38
 
39
39
  it 'should return an empty Hash' do
40
- get_xml("field", @object).should eq({})
40
+ expect(get_xml("field", @object)).to eq({})
41
41
  end
42
42
  end
43
43
 
@@ -45,7 +45,7 @@ describe XMLConverters do
45
45
  before { @object = KalibroGem::Entities::Model.new }
46
46
 
47
47
  it 'should return a Hash' do
48
- get_xml("field", @object).should be_a(Hash)
48
+ expect(get_xml("field", @object)).to be_a(Hash)
49
49
  end
50
50
 
51
51
  it 'should return the XML Hash' do
@@ -57,7 +57,7 @@ describe XMLConverters do
57
57
  }
58
58
  }
59
59
 
60
- get_xml("field", @object).should eq(field_xml_hash)
60
+ expect(get_xml("field", @object)).to eq(field_xml_hash)
61
61
  end
62
62
  end
63
63
  end
@@ -24,29 +24,28 @@ describe KalibroGem do
24
24
 
25
25
  describe 'config' do
26
26
  it 'should return the default configuration' do
27
- KalibroGem.config.should eq({
27
+ expect(KalibroGem.config).to eq({
28
28
  address: "http://localhost:8080/KalibroService/"
29
29
  })
30
30
  end
31
31
  end
32
32
 
33
33
  describe 'configure' do
34
- after(:all) {KalibroGem.configure(config)}
35
-
36
34
  it 'should set the address' do
37
35
  KalibroGem.configure({address: 'http://test.test'})
38
- KalibroGem.config.should eq({address: 'http://test.test'})
36
+ expect(KalibroGem.config).to eq({address: 'http://test.test'})
37
+ KalibroGem.configure(config)
39
38
  end
40
39
  end
41
40
 
42
41
  describe 'configure_with' do
43
42
  context 'with an existent YAML' do
44
- after(:all) {KalibroGem.configure(config)}
45
-
46
43
  it 'should set the config' do
47
44
  KalibroGem.configure_with('spec/savon/fixtures/config.yml')
48
45
 
49
- KalibroGem.config.should eq({address: 'http://test1.test1'})
46
+ expect(KalibroGem.config).to eq({address: 'http://test1.test1'})
47
+
48
+ KalibroGem.configure(config)
50
49
  end
51
50
  end
52
51
 
@@ -58,7 +57,7 @@ describe KalibroGem do
58
57
 
59
58
  it 'should keep the defaults' do
60
59
  KalibroGem.configure_with('spec/savon/fixtures/inexistent_file.yml')
61
- KalibroGem.config.should eq({address: "http://localhost:8080/KalibroService/"})
60
+ expect(KalibroGem.config).to eq({address: "http://localhost:8080/KalibroService/"})
62
61
  end
63
62
 
64
63
  it 'should log an warning' do
@@ -76,7 +75,7 @@ describe KalibroGem do
76
75
 
77
76
  it 'should keep the defaults' do
78
77
  KalibroGem.configure_with('spec/savon/fixtures/invalid_config.yml')
79
- KalibroGem.config.should eq({address: "http://localhost:8080/KalibroService/"})
78
+ expect(KalibroGem.config).to eq({address: "http://localhost:8080/KalibroService/"})
80
79
  end
81
80
 
82
81
  it 'should log an warning' do
@@ -91,7 +90,7 @@ describe KalibroGem do
91
90
  context 'Logger' do
92
91
  describe 'logger' do
93
92
  it 'should return the default logger' do
94
- KalibroGem.logger.should be_a(Logger)
93
+ expect(KalibroGem.logger).to be_a(Logger)
95
94
  end
96
95
  end
97
96
 
@@ -101,7 +100,7 @@ describe KalibroGem do
101
100
 
102
101
  KalibroGem.logger = logger
103
102
 
104
- KalibroGem.logger.should eq(logger)
103
+ expect(KalibroGem.logger).to eq(logger)
105
104
  end
106
105
  end
107
106
  end