Skip to content

Commit 9164f15

Browse files
committed
fixes #15 avoid execution of tests that depend on 4k pagesize
1 parent a367307 commit 9164f15

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

spec/vmstat/procfs_spec.rb

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ def self.procfs_path
3030
subject { procfs.memory }
3131

3232
it { should be_a(Vmstat::Memory) }
33-
it do
34-
should == Vmstat::Memory.new(4096, 4906, 6508, 8405, 107017, 64599, 1104)
35-
end
33+
if `pagesize`.chomp.to_i == 4096
34+
it do
35+
should == Vmstat::Memory.new(4096, 4906, 6508, 8405, 107017, 64599, 1104)
36+
end
3637

37-
it "should have the right total" do
38-
(subject.wired_bytes + subject.active_bytes +
39-
subject.inactive_bytes + subject.free_bytes).should == 507344 * 1024
38+
it "should have the right total" do
39+
(subject.wired_bytes + subject.active_bytes +
40+
subject.inactive_bytes + subject.free_bytes).should == 507344 * 1024
41+
end
4042
end
4143
end
4244

@@ -67,6 +69,8 @@ def self.procfs_path
6769
subject { procfs.task }
6870

6971
it { should be_a(Vmstat::Task) }
70-
it { should == Vmstat::Task.new(4807, 515, 2000, 0) }
72+
if `pagesize`.chomp.to_i == 4096
73+
it { should == Vmstat::Task.new(4807, 515, 2000, 0) }
74+
end
7175
end
7276
end

spec/vmstat/solaris_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,10 @@ def c.`(cmd)
249249
subject { solaris.memory }
250250

251251
it { should be_a(Vmstat::Memory) }
252-
it do
253-
should == Vmstat::Memory.new(4096, 409145, 9018, 0, 61103, 0, 0)
252+
if `pagesize`.chomp.to_i == 4096
253+
it do
254+
should == Vmstat::Memory.new(4096, 409145, 9018, 0, 61103, 0, 0)
255+
end
254256
end
255257
end
256258

0 commit comments

Comments
 (0)